Issue Details (XML | Word | Printable)

Key: AMQ-2052
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Jencks
Reporter: David Jencks
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

unsubscribing a durable subscriber does not properly clean up undelivered messages

Created: 01/Jan/09 04:10 AM   Updated: 03/Sep/09 08:51 AM
Return to search
Component/s: Message Store
Affects Version/s: 5.3.0
Fix Version/s: 5.3.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works AMQ-2052-test.patch 2009-01-01 04:15 AM David Jencks 4 kB


 Description  « Hide
Working on the tck I found a lot of messages like
2008-12-25 11:37:08,567 ERROR [RecoveryListenerAdapter] Message id ID:pb.local-56923-1230232035140-2:13:1:1:1 could not be recovered from the data store - already dispatched
in the log. I can reproduce this with the attached test case (It could probably be in a better module, but I started looking here.)

To see the error put a breakpoint at RecoveryListenerAdapter line 61 and run the test. The required steps to reproduce seem to be:

1. create a durable subscriber on a topic.
2. send a message to the topic.
3. close the subscriber and unsubscribe.
4. create a new durable subscriber on the same topic.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
David Jencks added a comment - 01/Jan/09 04:15 AM
Test case to deomonstrate the problem. Note that the test passes, you have to put a breakpoint to see the problem.

David Jencks made changes - 01/Jan/09 04:15 AM
Field Original Value New Value
Attachment AMQ-2052-test.patch [ 17467 ]
730596 by  David Jencks (2 files)
01/Jan/09 12:15 PM (10 months, 22 days ago)
Repository Revision Date User Message
AMQ #730596 Thu Jan 01 12:15:30 PST 2009 djencks AMQ-2052 Be careful about when to use a file-system-safened id
Files Changed
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java

730598 by  David Jencks (1 file)
01/Jan/09 12:18 PM (10 months, 22 days ago)
AMQ-2052 Throw an exception when references to non-existent messages are encountered
trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/RecoveryListenerAdapter.java 730598 history download (+1 -2) diffs

Repository Revision Date User Message
AMQ #730598 Thu Jan 01 12:18:08 PST 2009 djencks AMQ-2052 Throw an exception when references to non-existent messages are encountered
Files Changed
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/RecoveryListenerAdapter.java

David Jencks added a comment - 01/Jan/09 12:18 PM
The actual problem causing this is confusion over when to use a file-system-safened ID. Fixed in rev 730596.

I'm also changing the RecoveryListenerAdapter to throw an exception when it gets into this inconsistent state. Rev 730598.

I may try to simplify when and where the file system safening occurs. I also plan to move the test case to a better location.


David Jencks made changes - 01/Jan/09 12:18 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
David Jencks added a comment - 01/Jan/09 12:28 PM
Code inspection shows there are still a lot more confusions about when to use a file system safened name.

David Jencks made changes - 01/Jan/09 12:28 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
AMQ #730614 Thu Jan 01 13:37:17 PST 2009 djencks AMQ-2052 more better fixes of where to make the name file system safe
Files Changed
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/ContainerId.java
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/KahaStore.java
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/container/MapContainerImpl.java

David Jencks added a comment - 01/Jan/09 01:44 PM
I think rev 730614 is an OK fix.... still need the test case.

Repository Revision Date User Message
AMQ #730817 Fri Jan 02 11:06:55 PST 2009 djencks AMQ-2052 another file name problem
Files Changed
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataFile.java
MODIFY /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/data/DataManagerImpl.java

David Jencks added a comment - 02/Jan/09 11:12 AM
One more major file name problem... rev 730817. Surprisingly this only caused 13 test failures.

Jim Taylor added a comment - 19/Jun/09 06:57 AM
What is the work around after the store gets into this state? Is there one?

Gary Tully added a comment - 25/Jun/09 09:22 AM
David, are you done with this or is there more work needed to get the tck passing?

David Jencks added a comment - 03/Sep/09 08:51 AM
I've fixed all the problems I can find related to this so I'm closing this.

David Jencks made changes - 03/Sep/09 08:51 AM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]
Create crucible review for all 4 changesets in