candlepin event queue is not de-duplicated during processing, causing large numbers of events to fire
If you fill up the candlepin event listener queue with a large number of incoming messages, it may tax the system with many calls to candlepin. Eventually, odd things start to happen like DB locks.
There are likely a number of solutions to this, but one way to significantly reduce the number of actions taken would be to read through a large set of messages (perhaps 100), then make one call per pool that was updated (see https://github.com/Katello/katello/blob/master/app/lib/actions/candlepin/candlepin_listening_service.rb#L86).
It may also be worthwhile to increase the sleep from 1 to 5, so we can get a larger number of messages queued up to de-duplicate at once.