You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "sijonelis (via GitHub)" <gi...@apache.org> on 2026/06/22 10:16:39 UTC

[PR] Artemis 6008 [artemis]

sijonelis opened a new pull request, #6533:
URL: https://github.com/apache/artemis/pull/6533

   [issues.apache.org/jira/browse/ARTEMIS-3664](https://issues.apache.org/jira/browse/ARTEMIS-3664) fixed an issue with Critical Analyzer killing the broker during slow startup.
   
   However, during live/backup pair failover when the backup node is in the STARTED state, the Critical Analyzer would still evaluate the node as unhealthy under large journal/slow network disk conditions and kill it.
   
   This change proposes to switch the Critical Analyzer to LOG mode while the backup node is activating.
   
   I have debated between adding a new ServerState and adding a boolean flag (as done in this PR). Finally, I have decided to go with the flag as this change is a minor bug fix and should not warrant a significantly wider change of adding a new ServerState, however I would gladly do that if asked by the maintainers.


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4791928298

   > @jbertram do you think it's worth opening additional PR for that?
   
   Sure. Do you plan on sending a PR?


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #6533:
URL: https://github.com/apache/artemis/pull/6533#discussion_r3464371405


##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerStartupTest.java:
##########


Review Comment:
   Technically speaking reflection will work here. However, plumbing already exists to test this in a more robust way, e.g.:
   ```java
      private void testTooLongToStart(CriticalAnalyzerPolicy policy) throws Exception {
   
         try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) {
   
            ConfigurationImpl configuration = new ConfigurationImpl();
            configuration.setCriticalAnalyzerPolicy(policy);
            configuration.setCriticalAnalyzer(true);
            configuration.setPersistenceEnabled(false);
            ActiveMQServerImpl server = new ActiveMQServerImpl(configuration);
            addServer(server);
            CountDownLatch latch = new CountDownLatch(1);
            server.registerActivateCallback(new ActivateCallback() {
               @Override
               public void preActivate() {
                  try {
                     latch.await();
                  } catch (InterruptedException e) {
                     throw new RuntimeException(e);
                  }
               }
            });
            CompletableFuture.runAsync(() -> {
               try {
                  server.start();
               } catch (Exception e) {
                  e.printStackTrace();
               }
            });
            Wait.waitFor(() -> server.getCriticalAnalyzer() != null);
            CriticalAnalyzerAccessor.fireActions(server.getCriticalAnalyzer(), new CriticalComponentImpl(server.getCriticalAnalyzer(), 2));
            assertTrue(loggerHandler.findText("AMQ224116"));
            assertFalse(server.isActive()); // should not be changed
            latch.countDown();
            server.stop();
         }
      }
   ```
   By starting the broker async and forcing it to stall using a custom activation callback we don't need any reflection and we test the actual condition rather than an approximation.



-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "gtully (via GitHub)" <gi...@apache.org>.
gtully commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4831967537

   org.apache.activemq.artemis.core.server.impl.ActiveMQServerStartupTest fails on main, something is not right.


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4769525824

   I think instead of checking the server state you could just check `ActiveMQServer#isActive` and that would work for both the primary and the backup use-cases and you wouldn't need to add another field. What do you think?


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on code in PR #6533:
URL: https://github.com/apache/artemis/pull/6533#discussion_r3464734672


##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerStartupTest.java:
##########


Review Comment:
   Agree. Updated the test



-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4833118698

   I’ll take a look at the rebased code in a bit as well!
   
   Pagarbiai,
   
   Simas Joneliūnas
   
   On Mon, 29 Jun 2026 at 21:09, Gary Tully ***@***.***> wrote:
   
   > *gtully* left a comment (apache/artemis#6533)
   > <https://github.com/apache/artemis/pull/6533#issuecomment-4832951499>
   >
   > thanks for peeking. I have re based the branch, but I still see something
   > odd on my end, both on main on on that branch. that test from my ide hangs!
   > I need to investigate some more. thanks!
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/artemis/pull/6533?email_source=notifications&email_token=ABG5WVURBO67DDLOAJDWXRL5CJTAJA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBTGI4TKMJUHE42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4832951499>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ABG5WVRKI2S5DCM6ONYWUB35CJTAJAVCNFSNUABEKJSXA33TNF2G64TZHMZTMMBVG4ZDMMB3JFZXG5LFHM2DOMJVGYZTGOJVG6QXMAQ>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4775034354

   > wouldn't need to add another field. Wh
   
   Let me try that! it would be great if I can escape adding the extra flag


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "gtully (via GitHub)" <gi...@apache.org>.
gtully commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4832951499

   thanks for peeking. I have re based the branch, but I still see something odd on my end, both on main on on that branch. that test from my ide hangs! I need to investigate some more. thanks!


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "ViliusS (via GitHub)" <gi...@apache.org>.
ViliusS commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4832143578

   I think @gtully is talking about this run https://github.com/apache/artemis/actions/runs/28234518439/job/83646008640?pr=6517#step:5:1123
   
   We tested this change in real shared cluster environment with:
   `<critical-analyzer-timeout>2000</critical-analyzer-timeout>`
   `<critical-analyzer-check-period>1000</critical-analyzer-check-period>`
   so I would not expect that the change is flawed overall.
   I also don't see it failing anywhere on main. Maybe the test itself is flaky or conflicts with proposed journal lock changes?


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on code in PR #6533:
URL: https://github.com/apache/artemis/pull/6533#discussion_r3464681788


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java:
##########
@@ -884,9 +892,7 @@ protected void initializeCriticalAnalyzer() throws Exception {
       final CriticalAnalyzerPolicy criticalAnalyzerPolicy = configuration.getCriticalAnalyzerPolicy();
       CriticalAction criticalAction = switch (criticalAnalyzerPolicy) {
          case HALT -> criticalComponent -> {
-            if (ActiveMQServerImpl.this.state == SERVER_STATE.STARTING) {

Review Comment:
   Fair enough, done!



-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4775025186

   can you rebase your commit, without a merge commit
   
   
   basicall:
   
    git pull --rebase upstream main
   
   
   And squash your commits as a single one?


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #6533:
URL: https://github.com/apache/artemis/pull/6533#discussion_r3464224270


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java:
##########
@@ -884,9 +892,7 @@ protected void initializeCriticalAnalyzer() throws Exception {
       final CriticalAnalyzerPolicy criticalAnalyzerPolicy = configuration.getCriticalAnalyzerPolicy();
       CriticalAction criticalAction = switch (criticalAnalyzerPolicy) {
          case HALT -> criticalComponent -> {
-            if (ActiveMQServerImpl.this.state == SERVER_STATE.STARTING) {

Review Comment:
   I think it would be more straight-forward to just change all the checks of `state` to use `isActive()` instead of adding a new method that does the same.



-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "ViliusS (via GitHub)" <gi...@apache.org>.
ViliusS commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4790129547

   We talked with @sijonelis about this PR offline. We wanted to include one more change before merging. The following log message is now technically not 100% correct:
   
   `@Message(id = 224116, value = "The component {0} is not responsive during start up. The Server may be taking too long to start", format = Message.Format.MESSAGE_FORMAT)`
   
   maybe change it to 
   
   `@Message(id = 224116, value = "The component {0} is not responsive. The Server may be taking too long to load", format = Message.Format.MESSAGE_FORMAT)`
   
   @jbertram do you think it's worth opening additional PR for that?


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "ViliusS (via GitHub)" <gi...@apache.org>.
ViliusS commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4792325418

   Yes, @sijonelis or me will do that.


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4789868259

   Nice work @sijonelis. Thanks for the PR!


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram merged PR #6533:
URL: https://github.com/apache/artemis/pull/6533


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4832429306

   I have checked the [fork in question](https://github.com/gtully/apache-artemis/tree/_ARTEMIS-6117) @gtully, and it seems to be 22 commits behind main. 
   
   I have updated the test case accoring to Justin's suggestion which now sets up a full async broker instead of manually injecting the desired state. 
   
   The `main` branch test now expects the new test harness but your code is still on the old one, hence the failing test. The issue should go away once you sync your fork.


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org


Re: [PR] ARTEMIS-6008 Prevent CriticalAnalyzer from killing the broker while failing over [artemis]

Posted by "sijonelis (via GitHub)" <gi...@apache.org>.
sijonelis commented on PR #6533:
URL: https://github.com/apache/artemis/pull/6533#issuecomment-4832036443

   @gtully Do you have a link to the failing run as i can't seem to find it on github? 
   The test in question pass locally on latest main, so I dont have a local repro


-- 
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: issues-unsubscribe@artemis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org