You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "mattrpav (via GitHub)" <gi...@apache.org> on 2026/10/22 09:55:20 UTC
[I] Bug: Queue size incorrect when IOException thrown [activemq]
mattrpav opened a new issue, #2736:
URL: https://github.com/apache/activemq/issues/2736
During message expiration, an IOException may throw and never retry
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact
Re: [I] Bug: Queue size incorrect when IOException thrown [activemq]
Posted by "ruthst00 (via GitHub) via gitbox" <gi...@activemq.apache.org>.
ruthst00 commented on issue #2736:
URL: https://github.com/apache/activemq/issues/2736#issuecomment-7002743603
@mattrpav, I'd like to submit a PR for this issue if that's OK with you. Here's my understanding of the problem:
### The Problem
- In [`Queue.messageExpired()`](/Users/ruthes00/github/activemq/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java#L1991), the expired count is incremented before removing the message. An `IOException` during removal is only logged.
- The queue-size decrement happens later in `dropMessage()`, after successful acknowledgement. A failed acknowledgement can therefore leave the queue count unchanged.
- [`Message.canProcessAsExpired()`](/Users/ruthes00/github/activemq/activemq-client/src/main/java/org/apache/activemq/command/Message.java#L865) uses a one-way atomic flag to prevent repeat expiration processing. This makes a naïve “try again on the next scan” approach insufficient.
- Some expiration paths also remove the message from the pending cursor before attempting store removal, so preserving access to the failed message matters.
### Recommended approach
1. Inject a one-time `IOException` during removal of a persistent expired message.
2. Reproduce the stuck queue count.
3. Make failed expiration removal recoverable, while avoiding duplicate DLQ forwarding, repeated expired-count increments, and double dequeues.
4. Verify that, after storage recovers, removal completes and queue size reaches zero. Also test repeated failures and normal expiration.
Existing expiration tests and `ProxyMessageStore` test patterns provide a useful starting point.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact
Re: [I] Bug: Queue size incorrect when IOException thrown [activemq]
Posted by "mattrpav (via GitHub) via gitbox" <gi...@activemq.apache.org>.
mattrpav commented on issue #2736:
URL: https://github.com/apache/activemq/issues/2736#issuecomment-7012812407
@ruthst00 I already have a PR for this one in review. It is very nuanced, and would not suggest this one for a new contributor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact