Comments (4)
Hey @plokhotnyuk
The program is exiting the try-with-resources block immediately after the two printlns so is starting and stopping the clustered service quickly. The consensus module is waiting to receive an acknowledgement from the clustered service and gets stuck waiting and eventually interrupted. In the try-with-resources block you should wait on the shutdown signal barrier:
clusteredMediaDriver.consensusModule().context().shutdownSignalBarrier().await();
from aeron.
@JPWatson Please reopen the issue, because adding of clusteredMediaDriver.consensusModule().context().shutdownSignalBarrier().await();
line doesn't solve the unexpected termination
error:
[0] Started Cluster Node on localhost...
[0] Exiting
Consensus Module
io.aeron.cluster.client.ClusterEvent: WARN - Aeron client in service closed unexpectedly
Consensus Module
io.aeron.cluster.client.ClusterException: WARN - failed to send service termination position: result=-1
at io.aeron.cluster.ServiceProxy.terminationPosition(ServiceProxy.java:219)
at io.aeron.cluster.ConsensusModuleAgent.unexpectedTermination(ConsensusModuleAgent.java:3219)
at io.aeron.cluster.ConsensusModuleAgent.slowTickWork(ConsensusModuleAgent.java:2104)
at io.aeron.cluster.ConsensusModuleAgent.doWork(ConsensusModuleAgent.java:338)
at org.agrona.concurrent.AgentRunner.doWork(AgentRunner.java:304)
at org.agrona.concurrent.AgentRunner.workLoop(AgentRunner.java:296)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:162)
at java.base/java.lang.Thread.run(Thread.java:1583)
Consensus Module
io.aeron.cluster.service.ClusterTerminationException: unexpected termination
at io.aeron.cluster.ConsensusModuleAgent.unexpectedTermination(ConsensusModuleAgent.java:3222)
at io.aeron.cluster.ConsensusModuleAgent.slowTickWork(ConsensusModuleAgent.java:2104)
at io.aeron.cluster.ConsensusModuleAgent.doWork(ConsensusModuleAgent.java:338)
at org.agrona.concurrent.AgentRunner.doWork(AgentRunner.java:304)
at org.agrona.concurrent.AgentRunner.workLoop(AgentRunner.java:296)
at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:162)
at java.base/java.lang.Thread.run(Thread.java:1583)
from aeron.
Pls just try do add Thread.sleep between releasing ClusteredServiceContainer and ClusteredMediaDriver in one of sample clusters. Either as shown (with Sleep() resource), or by nesting try-with-resources blocks and adding Thread.sleep in between.
from aeron.
The ClusteredService and ConsensusModule are monitoring each other so there will be a race between trying to shut each one down and the other being around to notice it. The graceful way to shut down a cluster is to run ClusterControl SHUTDOWN on the leader node. We have been exploring ways to more gracefully shut down a single node but there are no immediate plans to implement as it stands.
from aeron.
Related Issues (20)
- Two questions need to help HOT 2
- Image: Active Transport Count HOT 1
- MDC subscriber ephemeral port increased network traffic HOT 7
- are there any example of how to use aeron base on InfiniBand/RDMA HOT 1
- onStart is executed after doBackgroundWork in case snapshot exists HOT 1
- Local subscribers jammed on stuck image HOT 1
- How can the driver safely timestamp any fragment at an offset? HOT 5
- Unexpected timeout exception when client joining a cluster - cluster connect timeout HOT 2
- Does aeron support "ReadIndex Read" and "Lease Read" HOT 1
- Can use Cluster instead AeronCluster ? HOT 1
- After running the program for a period of time, the error "a fault occurred in a recent unsafe memory access operation in compiled Java code" is reported.
- Cluster cannot start if some nodes lost their files and log has been truncated in remaining nodes HOT 5
- `canClaim` or a similar mechanism HOT 1
- Question regarding Live replay subscription HOT 1
- [C]aeron_udp_channel_interceptor_table_length compute issue
- Cluster Follower's logChannel rejoin cost too much time HOT 1
- Build Issue with JDK 21 HOT 3
- Timeout exception - AeronCluster client with non-default ingress and egress stream-id HOT 1
- Connectivity for Spies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aeron.