fix(cas): handle disconnected HTTP and gRPC downloads

Merged
MI
15h ago
+154-3

Interrupted HTTP/2 downloads can reach Sentry as client disconnected, and interrupted gRPC downloads can report Unavailable: transport is closing during connection shutdown.

Check the HTTP request context for cancellation and classify unavailable outgoing gRPC streams as client disconnects. Handle the gRPC failure at the send boundary because the transport can close before it cancels the request context. Storage-backend Unavailable errors remain reportable.

Regression tests verify that disconnected downloads do not reach Sentry, HTTP cancellation does not attempt an error response, and active-request and backend failures remain reportable. Both regression cases failed before their fixes.

Validation:

  • go test ./app/artifact-cas/... passed.
  • Service lint reported no new issues against the base commit. Full service lint has five pre-existing findings.
  • A local HTTP/2 connection-close reproducer returned the exact client disconnected error in five consecutive runs.

Fixes ARTIFACT-CAS-4X
Fixes ARTIFACT-CAS-4W

Related: PFM-7939, PFM-7637.