Interruption in jeromq kills it
See original GitHub issueIt’s known that jeromq don’t like interruptions. But it hate it so much that an interruption at wrong time can kill it:
@Test(timeout = 1000)
public void testInterruptedClose() throws Throwable
{
ZContext ctx = new ZContext();
Socket s = ctx.createSocket(SocketType.PULL);
int port = Utils.findOpenPort();
s.bind("tcp://*:" + port);
Thread.currentThread().interrupt();
try {
s.close();
} catch (Exception ex) {
ex.printStackTrace();
}
// Reset the interrupt state
Thread.interrupted();
ctx.close();
}
An exception is of course throws during the close. But as the close is not really finished, the ctx.close will hang, the test fails with a timeout during the zmq.Ctx.terminate().
Is such a catastrophic failure expected ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
jeromq/interrupt.java at master - GitHub
public void run(). {. System.out.println("W: interrupt received, killing server..."); context.close();. try {. zmqThread.interrupt();. zmqThread.join();. }.
Read more >Cleanly interrupt zeromq polling thread - java - Stack Overflow
I have a multithreaded application written in Java using jeromq 0.3.2. I'm working on putting it into ...
Read more >Handling Interrupt Signals - ZeroMQ [Book] - O'Reilly
By default, these simply kill the process, meaning messages won't be flushed, files won't be closed cleanly, and so on. Example 2-10 shows...
Read more >ZContext (JeroMQ 0.5.2 API) - javadoc.io
It provides a simple way to set the linger timeout on sockets, and configure contexts for number of I/O threads. Sets-up signal (interrupt)...
Read more >zeromq/libzmq - Gitter
Does someone have idea about jeromq 0.5.2 java library ? I am facing issue with this library, ... Thread interrupts are specifically disallowed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve attempted to totally wrap my head around it before but unfortunately, it’s a bit too much effort and low on my personal priority list. The cognitively complexity of the internals of libzmq/jeromq is quite large
Fixed in #836