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

Bug in Pipe::processPipeTerm() if remote anomalously terminates -- unhandled WAITING_FOR_DELIMITER #891

Open
RalphSteinhagen opened this issue Jul 19, 2021 · 0 comments

Comments

@RalphSteinhagen
Copy link

The WAITING_FOR_DELIMITER state is not being handled in Pipe::processPipeTerm() when the function is being called a second time in response to an anomalously termination of the remote host, for example, if it terminates with a segfault or similar.
(N.B. simple ROUTER-DEALER connection with a multi-frame wire protocol).

I extended the function to print some extra information in the assertion and when the function is being called:

DEBUG - Pipe::processPipeTerm() - called with state = WAITING_FOR_DELIMITER inActive = false outActive = true
Exception in thread "iothread-2" java.lang.AssertionError: processPipeTerm received erroneous unexpected status WAITING_FOR_DELIMITER
        at zmq.pipe.Pipe.processPipeTerm(Pipe.java:373)
        at zmq.ZObject.processCommand(ZObject.java:87)
        at zmq.Command.process(Command.java:77)
        at zmq.io.IOThread.inEvent(IOThread.java:80)
        at zmq.poll.Poller.run(Poller.java:273)
        at java.base/java.lang.Thread.run(Thread.java:829)

After that, the pipe seems to stall/close silently and looping in other parts w/o the user being informed (other than the assertion in the user-inaccessible 'ioThread').

I presume that the original design did not include anomalously termination where part of the expected information will never be sent by the remote. Would it harm to add another case that explicitly terminates the pipe and relays that information to the user? Would there be other unexpected side effects?

Any help/insight would be much appreciated!

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