You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2026/05/06 19:04:27 UTC
[PR] RATIS-2521. LifeCycle.startAndTransition(..) may cause illegal transition: CLOSING -> EXCEPTION. [ratis]
szetszwo opened a new pull request, #1452:
URL: https://github.com/apache/ratis/pull/1452
See RATIS-2521
--
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@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2521. LifeCycle.startAndTransition(..) may cause illegal transition: CLOSING -> EXCEPTION. [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #1452:
URL: https://github.com/apache/ratis/pull/1452#discussion_r3209903302
##########
ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java:
##########
@@ -101,4 +104,68 @@ private static void testInvalidTransition(TriConsumer<LifeCycle.State, LifeCycle
}
}
+ @Test
+ public void testStartAndTransition() throws Exception {
+ final SimulatedServer simulatedServer = new SimulatedServer();
+ assertEquals(NEW, simulatedServer.getLifeCycleState());
+
+ final CompletableFuture<Throwable> f = CompletableFuture.supplyAsync(() -> {
+ try {
+ simulatedServer.start();
+ throw new AssertionError("start() should fail");
+ } catch (Exception e) {
+ return e.getCause();
+ }
+ });
+
+ Thread.sleep(100);
+ assertEquals(STARTING, simulatedServer.getLifeCycleState());
Review Comment:
Since the test is very simple, it is reliable to just use `Thread.sleep`.
An embarrassing reason is that TestRaftAsyncWithNetty often fails. It is not easy to pass all the tests. We probably should disable TestRaftAsyncWithNetty until it is fixed.
--
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@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2521. LifeCycle.startAndTransition(..) may cause illegal transition: CLOSING -> EXCEPTION. [ratis]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #1452:
URL: https://github.com/apache/ratis/pull/1452#discussion_r3206409770
##########
ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java:
##########
@@ -101,4 +104,68 @@ private static void testInvalidTransition(TriConsumer<LifeCycle.State, LifeCycle
}
}
+ @Test
+ public void testStartAndTransition() throws Exception {
+ final SimulatedServer simulatedServer = new SimulatedServer();
+ assertEquals(NEW, simulatedServer.getLifeCycleState());
+
+ final CompletableFuture<Throwable> f = CompletableFuture.supplyAsync(() -> {
+ try {
+ simulatedServer.start();
+ throw new AssertionError("start() should fail");
+ } catch (Exception e) {
+ return e.getCause();
+ }
+ });
+
+ Thread.sleep(100);
+ assertEquals(STARTING, simulatedServer.getLifeCycleState());
Review Comment:
Would using `JavaUtils.attemptUntilTrue` be better than `Thread.sleep`?
--
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@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2521. LifeCycle.startAndTransition(..) may cause illegal transition: CLOSING -> EXCEPTION. [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo merged PR #1452:
URL: https://github.com/apache/ratis/pull/1452
--
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@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org