Skip to content

Commit 2ce02a6

Browse files
fix: honour shutdown_requested_func and a held inbox lock (#27)
The work landed in #26. Its squash subject lost the Conventional Commit prefix -- my mistake on the merge, not the author's -- so release-please skipped the merge and these fixes would never have reached a release. This commit carries the record. It changes no code: #26 is already on master. * shutdown_requested_func was a parameter of both EventBatchProcessor.process_batch and OutboxPublisher.publish_batch, was forwarded between them, and was never consulted -- a caller could not stop a batch mid-flight however hard they asked. It is polled before the fetch and before each event now, untouched events come back in remaining_event_ids, and steps see it as ProcessingContext.shutdown_requested. * InboxMessageProcessor.process_in_transaction discarded the boolean from mark_processing, so when another worker held the lock the handler ran anyway and the transaction then failed at mark_completed: the work was done twice and surfaced as a handler failure rather than a lock conflict. The handler no longer runs, nothing is recorded as a failure, and the offset is left for redelivery. * OutboxMetrics.set_locked_batch_size was required by the protocol, implemented twice and called by nothing. It is set after every fetch, including an empty one. * The publisher loop printed in the README, the quick start and the user guide had no surrounding transaction. Since the library commits nothing, that loop locked rows, published them, wrote the outcome into an uncommitted transaction and threw it away -- republishing the same events forever. Reproduced against PostgreSQL 17 before the pages were corrected.
1 parent fb33ab4 commit 2ce02a6

0 file changed

File tree

    0 commit comments

    Comments
     (0)