More logs and metrics about ssh proxy #7017
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of our users have reported the ssh to cluster would suffer delay or disconnecting sometimes. This PR adds more metrics and logs to help clarify the different disconnection reasons:
ClientClosed, which is good, note that if the serverPINGis not receive aPONGin time (20s timeout by default), it is also considered as aClientDisconnect. ThePING/PONGmight be delayed by the event loop issue, but I never produce a case that long event loop blocks causePING/PONGtimeout.SSHToPodDisconnected, the ssh connection to pod is disconnected, usually caused by pod issue, e.g. the Pod is oomkilledKubectlPortForwardExit, the kubectl port-forward process under the ssh connection exits, I can reproduce this with very low probability when I start many long-lived ssh connections. The reason why the port-forward process exit is a follow-up and can be prioritized if we can have non-trivial probability of repros in any environment.The 3 cases are manually tested via killing port-forward process / pod / ssh process manually.
Tested (run the relevant ones):
bash format.sh/smoke-test(CI) orpytest tests/test_smoke.py(local)/smoke-test -k test_name(CI) orpytest tests/test_smoke.py::test_name(local)/quicktest-core(CI) orpytest tests/smoke_tests/test_backward_compat.py(local)