You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/02 06:44:21 UTC

[GitHub] [pulsar-helm-chart] lhotari opened a new pull request #223: Pass "-q 1" to netcat (nc) to fix issue with Zookeeper "ruok" probes when using NettyServerCnxnFactory

lhotari opened a new pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223


   ### Motivation
   
   There seem to be problems with the Zookeeper "ruok" probes when using recent version of Zookeeper with org.apache.zookeeper.server.NettyServerCnxnFactory . @frederic-kneier contributed a fix in https://github.com/apache/pulsar/pull/14088 where `-q 1` parameter is added to the `nc` command.
   
   ### Modications
   
   Replace `bin/pulsar-zookeeper-ruok.sh` probe with `bash -c 'echo ruok | nc -q 1 localhost 2181 | grep imok'`
   
   ### Additional context
   
   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.
   ```
   
   There's some explanation in https://stackoverflow.com/questions/4160347/close-vs-shutdown-socket/23483487 about shutdown vs. close for TCP sockets. When specifying `-q `, netcat (nc) will call "shutdown" for the socket after waiting for 1 socket. This sends a TCP FIN to the other end and starts a clean connection shutdown. I guess that the default for netcat-openbsd is that it will wait for the other end to close the connection unless `-q 1` is specified.
   This feels like a bug in Zookeeper.
   


-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-helm-chart] lhotari commented on a change in pull request #223: Improve Zookeeper "ruok" probes: use TLS port when TLS is enabled, specify "-q 1" for nc

Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223#discussion_r804576961



##########
File path: charts/pulsar/templates/zookeeper-statefulset.yaml
##########
@@ -151,7 +157,9 @@ spec:
             command:
             - timeout
             - "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}"
-            - bin/pulsar-zookeeper-ruok.sh
+            - bash

Review comment:
       Where did you mean adding a comment?




-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-helm-chart] lhotari merged pull request #223: Improve Zookeeper "ruok" probes: use TLS port when TLS is enabled, specify "-q 1" for nc

Posted by GitBox <gi...@apache.org>.
lhotari merged pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223


   


-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-helm-chart] eolivelli commented on a change in pull request #223: Improve Zookeeper "ruok" probes: use TLS port when TLS is enabled, specify "-q 1" for nc

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223#discussion_r804508083



##########
File path: charts/pulsar/templates/zookeeper-statefulset.yaml
##########
@@ -151,7 +157,9 @@ spec:
             command:
             - timeout
             - "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}"
-            - bin/pulsar-zookeeper-ruok.sh
+            - bash

Review comment:
       what about adding a comment about the fact that we are no more using "bin/pulsar-zookeeper-ruok.sh" ?
   
   




-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-helm-chart] eolivelli commented on a change in pull request #223: Improve Zookeeper "ruok" probes: use TLS port when TLS is enabled, specify "-q 1" for nc

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223#discussion_r804843537



##########
File path: charts/pulsar/templates/zookeeper-statefulset.yaml
##########
@@ -151,7 +157,9 @@ spec:
             command:
             - timeout
             - "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}"
-            - bin/pulsar-zookeeper-ruok.sh
+            - bash

Review comment:
       Here in this line
   It is strange that we are not using the script we provide with Pulsar.
   
   I understand the reason but it won't be clear to people reading this code




-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-helm-chart] lhotari commented on a change in pull request #223: Improve Zookeeper "ruok" probes: use TLS port when TLS is enabled, specify "-q 1" for nc

Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #223:
URL: https://github.com/apache/pulsar-helm-chart/pull/223#discussion_r808695020



##########
File path: charts/pulsar/templates/zookeeper-statefulset.yaml
##########
@@ -151,7 +157,9 @@ spec:
             command:
             - timeout
             - "{{ .Values.zookeeper.probe.readiness.timeoutSeconds }}"
-            - bin/pulsar-zookeeper-ruok.sh
+            - bash

Review comment:
       Thanks. I added this to the commit message 1c4f745941fda76e8ec532bc734b8499fe442b25 since it's easier to find the information there.




-- 
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: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org