Skip to content

JDBC Message Store - Reaper Can Reap Released Group of Messages [INT-2751] #6726

Closed

Description

@spring-operator

Gary Russell opened INT-2751 and commented

While a message group is in the process of being release normally, it is possible for the reaper to fire and find the same messages. Given that the group is locked (for normal processing), the reaper blocks waiting for the group. After the normal release completes, the messages are removed, and the lock released.

The reaper then continues, but fails to verify that the messages still exist in the group; hence the group is released a second time.

With some databases, Isolation.SERIALIZABLE may avoid the problem, but may cause other deadlocks depending on how the database is being used.

One possible solution will be to acquire the group lock in getMessageGroup() which is called by the reaper via the group store's iterator.

This will cause the reaper to block before doing the query, and the messages will never have existed as far as the reaper is concerned.


Affects: 2.1.3, 2.2 M4

Issue Links:

Activity

  1. spring-operator commented on Sep 17, 2012

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    PR: #627

  2. spring-operator commented on Sep 18, 2012

    @spring-operator
    ContributorAuthor

    Oleg Zhurakousky commented

    Merged and cherry-picked cleanly to 2.1

  3. spring-operator commented on Sep 19, 2012

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    JDBC stores message groups with a generated key, based on the correlationId returned from the correlation strategy, instead of under the correlationId itself.

    This causes issues with the reaper because it acquires a different lock for the same group, causing duplicate output messages under this JIRA race condition.

  4. spring-operator commented on Sep 19, 2012

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    Seems like a long-standing JMS MS issue where group.getGroupId() returns the UUID generated from the groupId instead of the original groupId.

  5. spring-operator commented on Sep 19, 2012

    @spring-operator
    ContributorAuthor

    Gary Russell commented

    New PR to resolve second issue that causes the same symptoms: #629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions