Skip to content

ARTEMIS-6142 FollowUp to fix tests - #6629

Open
clebertsuconic wants to merge 2 commits into
apache:mainfrom
clebertsuconic:ARTEMIS-6142
Open

ARTEMIS-6142 FollowUp to fix tests#6629
clebertsuconic wants to merge 2 commits into
apache:mainfrom
clebertsuconic:ARTEMIS-6142

Conversation

@clebertsuconic

Copy link
Copy Markdown
Contributor

The purpose I'm sending this PR is basically to open a discussion.

Certain failover tests are now failing with InVM. This is a major concern for Wildfly integratoin as they have a lot of tests doing that.

For reference run LockManagerBackupSyncJournalTest, and you wlil see the faliure without this change on this PR.

@MrEasy / @jbertram

@MrEasy

MrEasy commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Can confirm the LockManagerBackupSyncJournalTest showing this issue.
Did ran only mvn -Pfast-tests install so far, strictly following the guide ;)

Can also confirm test succeeds with your commit.
Have to wrap my head around the change again, but would agree, that in VMConnector the disconnect should always call connection.disconnect.

edit:
see below
or should it not better be like this? LockManagerBackupSyncJournalTest succeeds with that. Think in case of failed, connection should get closed and otherwise disconnected (was the other (wrong) way around in my commit):

   public void disconnect(final String connectionID, final boolean failed) {
      if (!started) {
         return;
      }

      Connection conn = connections.get(connectionID);

      if (conn != null) {
         if (failed) {
            conn.close();
         } else {
            conn.disconnect();
         }
      }
   }

That wrong logic would then however also be present in InVMConnector

edit 2:
nah, disconnect raises failed=true, so passing this along seems correct to me

@clebertsuconic

Copy link
Copy Markdown
Contributor Author

@MrEasy so, you think my fix is good with your changes?

@clebertsuconic
clebertsuconic marked this pull request as ready for review August 20, 2026 17:16
@clebertsuconic
clebertsuconic force-pushed the ARTEMIS-6142 branch 3 times, most recently from 0a62828 to ad333c7 Compare August 20, 2026 21:49
@clebertsuconic

Copy link
Copy Markdown
Contributor Author

I'm keeping the best of both worlds here. for a case where this is used on serverLocator.connect() the acceptor will close connections like it used to. while keeping your changes for regular clients.

@clebertsuconic
clebertsuconic force-pushed the ARTEMIS-6142 branch 3 times, most recently from ce68296 to 7845cd2 Compare August 20, 2026 23:36
Topology discovery on InVM (for collocated stuff, that some tests still
use). are using serverLocator.connect(); for those cases I'm keeping the
previous semantic on calling close and disconnect.

With that we will have the best scenario on each case. keeping the
previous semantics for clustering while fixing the regular client usage.

assisted by Claude
@clebertsuconic

Copy link
Copy Markdown
Contributor Author

we are doing a release very soon... and I reverted ARTEMIS-6142. Reapplied in this PR with some follow up that will need take place.

@MrEasy

MrEasy commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Sounds good to me - have to say not much experience with the mechanics in a clustering scenario.
Definitely still avoids the InVMConnections from leaking after close, which is the main point for me.

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.

2 participants