fix(inkless:storage): count retried GCS error responses #789
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 285 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.338
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #789"
general
weight: 0.35
giuseppelillo
Background
PR #783 added GCS error counters through an
HttpResponseInterceptor. The Google HTTP client invokes that interceptor only afterHttpRequest.execute()finishes its internal retry loop. When GCS returns401,HttpCredentialsAdaptercan refresh the token and retry the same request before the interceptor runs, so a successful refresh hides the failed response and repeated authorization failures are undercounted.The credentials handler also reinstalls itself after a refresh. Wrapping it without restoring the metrics wrapper would therefore count only the first
401from a request.Batch requests add a second distinction. The outer POST bypasses the request initializer, but each failed multipart sub-response invokes the unsuccessful-response handler. A
404delete means the object is already absent, andStorageBatchtreats that outcome as a confirmed idempotent delete, so counting it as a provider error creates noise during cleaner retries. GCS still bills and rate-limits every submitted delete sub-request, including refused requests, so the operation counter must include all of them.Changes
HttpUnsuccessfulResponseHandler, which runs before the client decides whether to retry each response.other-errors, while continuing to count refused and throttled sub-requests.object-deleteoperation; confirmed deletions remain available through cleaner metrics.other-errorsas non-4294xx responses, excluding absent batch deletes. Protocol responses such as308 Resume Incompletealso remain excluded.Testing
./gradlew :storage:inkless:test --tests io.aiven.inkless.storage_backend.gcs.MetricCollectorTest --tests io.aiven.inkless.storage_backend.gcs.integration.GcsErrorHandlingTest --tests io.aiven.inkless.storage_backend.gcs.integration.GcsStorageMetricsTest./gradlew :storage:inkless:genInklessMetricsDoc