Concurrent append safety in resumable-upload

Hi all,

I'm new to the working group. I've been implementing partial uploads
and wrote up an individual draft before I discovered the WG's
resumable upload work:

  https://datatracker.ietf.org/doc/draft-martinez-partial-content-uploads/

Having now read it properly, it covers a lot of the same ground and
covers much of it better. I'm not looking to pursue a parallel
document. Concurrent appends is at least one area where I think my
approach adds something. I have thoughts on a few other areas that
I'll raise separately rather than pile them into one thread.

Section 4.6 says:

  Resumable uploads, as defined in this document, do not permit
  uploading representation data in parallel requests for the same
  upload. The client MUST NOT perform multiple representation data
  transfers for the same upload resource in parallel, or perform
  representation data transfers while the creation of the same upload
  resource is still in progress.

and then requires servers to "take measures to prevent race
conditions, data loss and corruption from concurrent requests," with a
SHOULD to terminate the previous request when a new one arrives.

I see this text was tightened recently in response to issue #3485, and
I want to be clear that what follows is orthogonal to that. That issue
was about the prohibition being scoped imprecisely. My concern is that
the prohibition has no detection mechanism at all. It is stated as
client conformance plus unspecified server behavior with nothing on
the wire.

Upload-Offset does function as a precondition, and it handles the case
it was designed for: a client racing itself. Two requests targeting
the same offset cannot both win and the loser gets a 409.

What an offset cannot express is identity. Consider two clients that
both hold the same upload URL:

  Client A: PATCH, Upload-Offset: 0      (server offset -> 100)
  Client B: PATCH, Upload-Offset: 100    (server offset -> 200)
  Client A: PATCH, Upload-Offset: 200    (server offset -> 300)

Every request is individually valid. Every offset check passes. The
server has no way to know the resulting representation is spliced from
two sources and neither client learns anything is wrong. The upload
completes and validates.

Section 4.6 forbids this, but nothing detects it. It rests on the
upload URL not being shared, which holds right up until it doesn't: a
URL persisted and resumed by a second process, a client library used
from two threads, a handoff between foreground and background
uploaders, or the same logical upload attempted from two machines.

The approach I took was to have the server issue an entity tag when
the upload resource is created and have appends carry it in If-Match
with 412 on mismatch and 428 when it is absent. That separates
identity from position. The offset says where you are; the tag says
which upload sequence you belong to. A second client appending at a
valid offset with a stale or absent tag is rejected explicitly rather
than silently accepted. It is ordinary RFC 9110 conditional request
handling rather than a new mechanism.

There is a second benefit I did not anticipate when I started. Today,
if two clients happen to target the same logical resource, the first
incomplete transfer effectively blocks the second until it completes
or the upload expires. An entity tag lets those operations interleave
with a predictable failure mode instead of an indefinite wait.

To be clear about what I am not proposing: my own draft makes If-Match
REQUIRED, which is heavier than I think this document would want, and
I am not attached to that. The transplantable part is optional. A
server that cares about this case can issue a tag and reject appends
that don't carry it, and clients that don't participate behave exactly
as they do today.

There is a cost, of course - another field on every append and potentially
more state for the server to keep. The "don't share the upload URL" may
simply be the right answer for this document's scope; however, a
resource with well-known source file path might produce a shared
upload URL organically. If not sharing the URL is the expectation, I think
that it is worth stating explicitly because a reader of 4.6 today can
reasonably conclude the server is meant to be detecting this and there
is nothing for it to detect with.

Related to that and offered more tentatively, if a deterministic
mechanism exists, the MUST NOT may be stronger than it needs to be.
Whether a second transfer against the same upload is handled
optimistically or pessimistically could reasonably be left to origin
server policy.

I'm happy to move this to the issue tracker if that's a better home,
or to write it up as a PR if there's interest.

Regards,
Chris 

Received on Friday, 4 September 2026 09:52:05 UTC