lhotari commented on pull request #14088:
URL: https://github.com/apache/pulsar/pull/14088#issuecomment-1027613244
> @lhotari calling "echo ruok | nc -q -1 localhost 2181" does not solve the
problem. It has to be "echo ruok | nc -q 1 localhost 2181"
@frederic-kneier ok, good to hear about that. I'm trying to understand the
reason why it fixes the problem.
> If you pipe the command to nc the input stream is closed instantly which
leads to nc terminating in certain conditions even before the server is able to
send the reply.
In this case, this explanation doesn't seem to hold. The apache/pulsar:2.8.2
image contains netcat-openbsd and for it, `-q -1` is the default and would
prevent closing the socket after stdin EOF.
Here's some parts of the man page for netcat-openbsd nc
```
-N shutdown(2) the network socket after EOF on the input. Some
servers require this to finish their work.
-q seconds
after EOF on stdin, wait the specified number of seconds and
then quit. If seconds is negative, wait forever (default). Specifying a
non-negative seconds implies -N.
```
It says "Some servers require this to finish their work". I wonder why this
is the case for Zookeeper. It seems to happen only when Zookeeper is configured
using `org.apache.zookeeper.server.NettyServerCnxnFactory`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]