Repository navigation
Conversation
…eue; listen on the lower-case channel
This was referenced Nov 9, 2026
Recent PHPStan 2.2.x infers the nested property assignment correctly, so the ignore is unmatched and phpstan fails on every cell of the CI matrix (8.4/8.5 x lowest/highest).
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.
Closes #4. Closes #3.
pgmq's insert trigger updates the queue's row in
pgmq.notify_insert_throttleon every insert, and that row stays locked until the sender commits. Senders to one queue wait for each other, and two transactions sending to two queues in opposite order deadlock (details and a reproduction in #4).This PR stops relying on the trigger:
pgmq_dispatch_v1()callspg_notify()itself, on the channel the trigger used (pgmq.q_<queue>.INSERT), so consumers listen exactly as before. Forpublishit notifies every queuesend_topic()routed the message to. Postgres delivers the notification on commit, never for a rolled-back send, and folds identical notifications within one transaction.createQueue()undoes an earlier setup without stalling a live queue: it deletes the throttle row first (without it the trigger locks nothing), then drops the trigger with a 2 slock_timeout. A busy queue keeps its trigger until the next setup, with a warning. With nothing to undo, it only reads the catalog.Trade-offs:
pgmq.send(), bypassing the bus, no longer wakes the consumer; it's picked up by the next poll.Replaces the trigger handling in #7 and doesn't need a new
thesis/pgmqrelease. Integration tests come in a separate PR on top of #8.