Skip to content

🐛 Fix message settlement, failed to open connections, and a few smaller bugs - #311

Merged
aleksul merged 6 commits into
mainfrom
aleksul/fix-message-settlement
Sep 12, 2026
Merged

aleksul merged 6 commits into
mainfrom
aleksul/fix-message-settlement

Conversation

@aleksul

@aleksul aleksul commented Sep 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

@aleksul aleksul changed the title Aleksul/fix message settlement Fix message settlement, failed to open connections, and a few smaller bugs Sep 12, 2026
@aleksul
aleksul force-pushed the aleksul/fix-message-settlement branch from 060b507 to aa846f5 Compare September 12, 2026 01:35
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 12, 2026

Copy link
Copy Markdown

Deploying repid with  Cloudflare Pages  Cloudflare Pages

Latest commit: c226e2d
Status: ✅  Deploy successful!
Preview URL: https://0d1ccfb3.repid.pages.dev
Branch Preview URL: https://aleksul-fix-message-settleme.repid.pages.dev

View logs

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Coverage Report

Name Stmts Miss Cover Missing
TOTAL 8801 0 100%

105 files skipped due to complete coverage.

@aleksul
aleksul force-pushed the aleksul/fix-message-settlement branch 2 times, most recently from 81831b4 to eb18090 Compare September 12, 2026 15:43
@aleksul aleksul changed the title Fix message settlement, failed to open connections, and a few smaller bugs 🐛 Fix message settlement, failed to open connections, and a few smaller bugs Sep 12, 2026
Combine the per-broker settlement fixes into one change: NATS, SQS,
Pub/Sub, Redis, and AMQP now reserve the settlement action
synchronously before the first await of every ack/nack/reject/reply,
making the check-and-set atomic in a single event loop. Concurrent
settlements are deduplicated, keep-alive renewals cannot race
settlements, and a settlement cancelled mid-RPC stays reserved so a
second settlement is never issued. Only a real failure releases the
reservation for a retry.

- NATS: serialize settlement and reply operations (incl. DLQ fallback)
- SQS: serialize settlement operations (incl. keep-alive renewal)
- Pub/Sub: cancellation-safe control batcher operations
- Redis: serialize settlement operations
- AMQP: serialize disposition settlements
- Kafka/in-memory: already reserve before awaiting; unchanged
- Pub/Sub message layer simplified to plain reservation

Additionally: in Kafka: drop the unused module-level logger
- Kafka: stop the producer when start() fails
- Redis: close the client when ping() fails; catch real connection
  errors in retry/reclaim loops
- AMQP: close the connection on failed connect and drop stale
  connections before reconnecting
- Pub/Sub: only mark the broker connected after channel, protocol
  client and control batcher are all up; close the channel on failure
- NATS: clear a stale client before reconnecting
@aleksul
aleksul force-pushed the aleksul/fix-message-settlement branch from eb18090 to c226e2d Compare September 12, 2026 15:53
@aleksul
aleksul merged commit d2965a3 into main Sep 12, 2026
13 checks passed
@aleksul
aleksul deleted the aleksul/fix-message-settlement branch September 12, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant