Add configurable timeout to netcat calls with 10s default #78370
Add configurable timeout to netcat calls with 10s default #78370gongomgra merged 1 commit intobitnami:mainfrom
Conversation
d63aada to
3d66450
Compare
|
@mati865 thanks for your contribution! What do you think about adding a new parameter to the |
|
@gongomgra I considered this from the beginning, but opted for an easy fix/workaround to avoid spending too much time investigating the scripts' interdependencies. If this is just a matter of adding it to one more script per chart, I can certainly look into that. |
3d66450 to
fe39aca
Compare
Without any timeout, netcat can get stuck forever (until Kubernetes kills unhealthy Pod) when configured address and port combination is wrong, or the connection gets stuck. For example `nc -z bitnami.com 12345` doesn't seem to ever finish. In the case when an attempt gets stuck, the timeout will allow further attempts to be performed, instead of waiting until Pod is killed. Signed-off-by: Mateusz Mikuła <oss@mateuszmikula.dev>
fe39aca to
f465deb
Compare
|
@gongomgra thank you for the pointers, updated commit, description and title. The diff of the changes since your initial review is available at: https://github.com/bitnami/containers/compare/3d664506660480823bbcc01c6582e3256f038a0b..fe39acaf1defd3c57b5d7a3c9d287d32d7315447 I have used 10s as the default value, so this change is backwards compatible. |
gongomgra
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
Description of the change
Without any timeout, netcat can get stuck forever (until Kubernetes kills unhealthy Pod) when configured address and port combination is wrong, or the connection gets stuck.
For example
nc -z bitnami.com 12345doesn't seem to ever finish.Benefits
In the case when an attempt gets stuck, the timeout will allow further attempts to be performed, instead of waiting until Pod is killed.
Possible drawbacks
When the timeout is too short, valid configurations might falsely show as broken. Thus, I chose 10s which should be long enough.
Applicable issues
Additional information
Default 10s timeout is very conservative and should not cause spurious failures, users are advised to shorten it according to their needs.