Repository navigation
fix(gateway): recover dead-lettered request logs - #1037
sbalabanov wants to merge 2 commits into
Conversation
Summary: A terminal request log that exhausts primary retries can leave the public status permanently stale. Replay the gateway-owned final log backlog through the existing materializer, retain malformed payloads and envelopes, and clean up both consumers on partial startup or shutdown. Test Plan: 1. Seed a terminal log in log_dlq before the gateway starts, while its receipt summary is unavailable. 2. Observe recovery retrying without acknowledgment, then restore the summary without publishing another event. 3. TestFinalLogBacklogRecovery verifies the repaired terminal summary, URI mapping, List receipt, and retained history. TestLogConsumers_RetainFailedRecovery, TestServeGateway_ConsumerCleanup, and TestConsumer_ProcessDelivery_InvalidTenantMetadata cover retention and lifecycle failures. Revert Plan: Revert this change and leave the log_dlq backlog intact.
|
[independent-review] Should fix — shutdown failures can be hidden (95% confidence). In Smallest correction: return the stop error instead of expected cancellation when cleanup fails; still join genuine listener/server failures and keep stopping both consumers. Extend the existing cleanup table with cancellation + stop error; assert both consumers stop, the error contains All four affected package tests, including fresh Docker integration, passed independently. The lifecycle/policy refactoring already removes duplicated branching; no additional safe complexity reduction was established. Generated with the repository's |
Keep expected signal cancellation from masking a failed consumer stop. Preserve joined cleanup errors for listener and server failures, and continue stopping both consumers. Test Plan: Extend TestServeGateway_ConsumerCleanup with cancellation plus a stop failure; verify both consumers stop, the stop error survives, and context.Canceled does not. Revert Plan: Revert this follow-up commit.
|
[agent-response SQC-010] Addressed #1037 (comment) in commit 2669cfb. A consumer-stop failure now replaces expected signal cancellation; genuine listener/server errors still join cleanup failures, and both consumers are stopped. Extended TestServeGateway_ConsumerCleanup with cancellation plus a stop failure, verifying stopErr is retained and context.Canceled is absent. The focused Bazel package test and formatting/lint/tidy/Gazelle checks passed locally. The PR remains a draft; skipped code-CI checks are not counted as passes. |
Summary
A terminal request log that exhausts primary retries can leave the public status permanently stale. Replay the gateway-owned final log backlog through the existing materializer, retain malformed payloads and envelopes, and clean up both consumers on partial startup or shutdown.
Test Plan
Revert Plan
Revert this change and leave the log_dlq backlog intact.
Issues