Skip to content

ARTEMIS-5349 Bridges with concurrency can leak #5557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AntonRoskvist
Copy link
Contributor

This affects bridges whose configuration has been persisted. Simply adding persistence to the pre-existing test case captures this bug.

@clebertsuconic
Copy link
Contributor

What's leaking?...

I would recommend adding a test under ./leak-tests...

It is using a pet library I created... you can write code like this:

CheckLeak leak = new CheckLeak();
Assert.equals(0, checkLeak.getInstances("your-leaking-class").length);

@AntonRoskvist
Copy link
Contributor Author

What's leaking?...

I would recommend adding a test under ./leak-tests...

It is using a pet library I created... you can write code like this:

CheckLeak leak = new CheckLeak(); Assert.equals(0, checkLeak.getInstances("your-leaking-class").length);

Bridges where leaking, such that on all configuration reloads, concurrency number of new bridges where added each time and the previous ones where left without management.

The effect would be an ever increasing amount of consumers connected to the bridged queue that could not be closed, except from a broker restart.

@@ -62,7 +62,7 @@ public void decode(ActiveMQBuffer buffer) {
}

public String getName() {
return bridgeConfiguration.getParentName();
return bridgeConfiguration.getName();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a required change? it seems un-related.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clebertsuconic It's not strictly necessary, but without it each configuration reload will log WARN messages (AMQ222124).

I'll go ahead and change it so that the ActiveMQServerImpl#recoverStoredBridges() fetches this value from the underlying bridgeConfig instead and leave the PersistedBridgeConfiguration as it was.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If needed keep it.. just trying to understand why and if it was not a left over from a debug or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AntonRoskvist I wasn't trying to prevent a change to stating it was wrong BTW.

@clebertsuconic
Copy link
Contributor

I ran the complete testsuite on this.. and there is a failure here:

org.apache.activemq.artemis.tests.integration.persistence.ConfigChangeTest.bridgeConfigChangesPersist

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@AntonRoskvist
Copy link
Contributor Author

I ran the complete testsuite on this.. and there is a failure here:

org.apache.activemq.artemis.tests.integration.persistence.ConfigChangeTest.bridgeConfigChangesPersist

@clebertsuconic Yeah I don't know how I missed that but thanks for catching it! The tests pass now and I will run the full testsuite in a few hours to really make sure I got it right this time.

@AntonRoskvist
Copy link
Contributor Author

@clebertsuconic testsuite looking good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants