Skip to content

Release v0.1.1 – Safer subscriber loop, graceful shutdown

Latest

Choose a tag to compare

@jasseem jasseem released this 01 Oct 05:50

This patch release hardens the FIFO subscriber loop to make production usage safer and more responsive.

✨ Highlights

  • Automatic roll-backs on all error paths
    fifoSubscriber.Start now rolls back the transaction if box initialization, message processing, or commit fails – preventing dangling or locked DB transactions.

  • Graceful shutdown & context awareness
    • The main processing loop now checks ctx.Done() on every iteration and during waits, exiting cleanly when the caller cancels the context.
    wait helper replaced time.Sleep with a select on <-ctx.Done() to avoid hanging during shutdown.

  • Context-aware waiting strategy
    • The wait logic remains the same (different back-off when messages were/weren’t found) but can now be interrupted instantly on shutdown.

🐛 Fixes

  • Eliminated potential resource leaks caused by un-rolled-back transactions.
  • Removed noisy duplicate log lines when retrying after errors.

🔧 Internal

  • Added wait(ctx, cause, d) helper replacing the old blocking wait.
  • Incremented code coverage of edge cases in subscriber loop.

No breaking API changes – a recommended drop-in upgrade for all users.