mirror of
https://github.com/versity/versitygw.git
synced 2026-09-23 00:14:15 +00:00
Round-3 review of the ownership model found that moving publication between the request path and the callback by hand leaves edges where a record is published twice or lost. The publication model is now structural instead: request paths only record outcomes, and the native teardown callback - which the ABI fires exactly once per destroyed session, after every completion call - is the single publisher. The READY handler records its outcome (success with the reported byte count, or the mapped failure) and lets the callback publish. A deferred recorder covers panic unwinds, so every path through the handler leaves a final outcome behind. A failed PREPARE finalization publishes through a consume-or-noop helper: when the finalizing call already reaped the session the entry is gone and the helper is a no-op, otherwise it publishes the failure itself. Unclaimed teardowns no longer all read as expiries: the record is classified from the native outcome, so a transfer that died on the wire, failed verification, or timed out carries its own code and status. The synthesized publication context runs on an immutable app, so string accessors copy instead of exposing the pooled request buffer to the asynchronously serializing event senders. Captured account and region strings are cloned for the same reason. The nil-error publication no longer asserts on the S3 error interface, and the panic marker is a proper internal S3 error. Unit tests cover the table semantics: expiry publication, first-record-wins, consume-or-noop failure publication, unregister, unknown sessions, error normalization, status mapping, and the outcome classification.