]> git.mxchange.org Git - quix0rs-gnu-social.git/commit
Fix for stuck queue messages: wrap processing in stomp transactions so our lack of...
authorBrion Vibber <brion@pobox.com>
Fri, 22 Jan 2010 20:35:05 +0000 (12:35 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 22 Jan 2010 20:52:56 +0000 (12:52 -0800)
commit6e4cad71e546505b4bb4a168c1b11b84a45b7889
tree933939d1750c1085ae19ac729fc85837f21c7816
parentc7507e7e9dafa6d6e054978e720e4fce3abc9929
Fix for stuck queue messages: wrap processing in stomp transactions so our lack of an ACK if PHP dies actually triggers redelivery.

Previously, messages once delivered would just get stuck in the queue seemingly forever if they never got ACKed.
Note this could lead to partial duplication, for instance if the OMB or Twitter queue handlers die after 1/2 of the outgoing sends.

Recommendations:
* catch exceptions more aggressively within queue handlers (so only PHP fatal errors are likely to kill in the middle)
* for processing that involves sending to multiple clients, consider a second queue similar to the XMPP output, eg for OMB:
 - first queue gets delivery list and builds message data, enqueueing it for each target address
 - second queue can handle each individual outgoing message (and attempt redelivery etc separately)

This would also protect better against a recurring error preventing delivery in the second part, and could spread out any slow sends over multiple threads.
lib/stompqueuemanager.php