bug-21002: When queue is full, periodically discard messages to avoid deadlock