Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMonitor stuck on close #984

Open
inad9300 opened this issue Mar 26, 2024 · 2 comments
Open

ZMonitor stuck on close #984

inad9300 opened this issue Mar 26, 2024 · 2 comments

Comments

@inad9300
Copy link

I have a setup like the following (in version 0.5.4):

monitor = new ZMonitor(context, socket);
monitor.add(CONNECTED, DISCONNECTED);
monitor.start();
monitorFuture = runAsync(() -> {
    while (!closed) {
        var event = monitor.nextEvent(1000);
        if (event != null)
            // Log event...
    }
});

...

closed = true;
monitor.close();
context.close();

From time to time, monitor.close() gets stuck, using 100% of a CPU, while context.close() never gets to run. (Meantime, the monitoring thread manages to effectively terminate.)

@inad9300
Copy link
Author

I confirm the same behavior with 0.6.0.

@inad9300
Copy link
Author

Commenting out monitor.close() above leads me to the following occasional exception:

Exception in thread "reaper-1" java.lang.AssertionError
        at zmq.Own.unregisterTermAck(Own.java:228)
        at zmq.SocketBase.pipeTerminated(SocketBase.java:1403)
        at zmq.pipe.Pipe.processPipeTermAck(Pipe.java:413)
        at zmq.ZObject.processCommand(ZObject.java:91)
        at zmq.Command.process(Command.java:79)
        at zmq.SocketBase.processCommands(SocketBase.java:1178)
        at zmq.SocketBase.inEvent(SocketBase.java:1336)
        at zmq.poll.Poller.run(Poller.java:275)

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

No branches or pull requests

1 participant