NS-020
documentedstatus-committed-before-outcome
S3 sends 200 OK before it knows whether the upload completed
- reads as
- CompleteMultipartUpload returns HTTP 200. Conclusion drawn: the object is assembled and present.
- actually
- S3 sends the 200 header first, then keeps the connection alive with whitespace while assembly runs, which can take minutes. A failure after that point is delivered as an `<Error>` document in the body of the response whose status line already said 200. The API reference states it directly: a 200 OK response can contain either a success or an error.
- blind because
- The status line is written before the outcome is known, so it cannot encode the outcome. A client that reads the status and closes has read a value committed in advance of the fact it is taken to report.
- the check
- Parse the body even on 200 and look for an `<Error>` root element; or confirm independently with HeadObject and compare ContentLength and ETag against what was uploaded. Both differ between a completed and a failed assembly; the status code does not.
- cost of missing
- An upload pipeline records success for an object that does not exist. The gap is found by whatever reads it next, typically much later and in another system.
- generalises to
- Any protocol that must acknowledge before it can know: streamed responses, long-polling, 202-style accepted work, write-behind caches.
- source
- docs.aws.amazon.com