Repository navigation
Interval 1: worker reliability fixes and replay delivery reporting - #13
Closed
quangshuynh wants to merge 3 commits into
Closed
quangshuynh wants to merge 3 commits into
quangshuynh wants to merge 3 commits into
Conversation
- Verify the schema revision on worker startup, as the API and CLI already do and as docs/operations/worker.md claimed. The worker now exits 1 instead of polling against a database it was not built for. - Hold every outbound attempt to an overall deadline of the connect and read timeouts combined. The client timeouts each bound a single wait, so a destination trickling bytes could keep a request open indefinitely, outliving the lease and stalling the batch and worker shutdown. - Stream the response and never read its body, so a destination cannot dictate how much memory an attempt uses. - End the read transaction opened by load_submissions before sending, so no transaction is held across outbound HTTP calls. - Record the rest of a batch when one completion fails to record, instead of abandoning every remaining result and forcing duplicate sends. - Warn at startup when FORMS_WORKER_LEASE_SECONDS does not outlast one attempt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An idempotent replay reported delivery.queued from the endpoint's current webhook configuration. If the webhook was added or removed after the original request, the replay claimed a delivery that did not exist, or denied one that did. It now reports whether the stored submission owes a delivery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI now installs SQLAlchemy 2.1, where Select is generic over a variadic row type, so the existing bound Select[Any] no longer accepts a two-entity select and mypy fails in list_submissions. Bound the type variable by a small protocol for "has where()" instead, which type checks on both 2.0 and 2.1 (pyproject allows sqlalchemy>=2.0). No runtime change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interval 1 reliability audit. Fixes six confirmed defects, each with a regression test that was watched failing before the fix. No schema change, no public API shape change.
Worker and delivery (
b7ac225)docs/operations/worker.mdalready claimed. It exits 1 instead of polling.load_submissionsopens is ended before the HTTP calls go out, so no transaction is held across outbound requests.FORMS_WORKER_LEASE_SECONDSdoes not outlast one attempt.Ingestion (
d7bcf89)delivery.queuedfrom the stored submission instead of the endpoint's current webhook configuration. Before, a replay was wrong whenever the webhook had been added or removed since the original request.The docs (worker, webhooks, delivery semantics, configuration reference, idempotency) are updated to match. Delivery is still at least once; nothing here claims exactly once.
Verification
pytest: 609 passed, 84 skipped (the PostgreSQL tests skip without a database)ruff check .,ruff format --check .,mypy,mkdocs build --strict: cleanpostgres-integrationjob for that coverage.Not in this PR (tracked for later intervals)
v0.2.1points at a commit whose__version__is still0.2.0, and it has no release notes/healthis liveness only, with no readiness check🤖 Generated with Claude Code