-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
JENKINS-40825 close resource leak, fix broken pipe error #182
JENKINS-40825 close resource leak, fix broken pipe error #182
Commits on Aug 9, 2017
-
JENKINS-40825 close resource leak, fix broken pipe error
First of all, `Launcher.launch` is called not once, but again and again. I.e. overwriting shared members of the enclosing class that a different thread is still using (and only cleaning the ones that were written last). That is a bad idea, and caused the thread and connection leak. So, move them (`watch` and `proc`) to local variables, and close them elsewhere: * `proc.kill()` should be taken care of by the shell step (that needs to be verified) * `watch` was already cleaned up in `ContainerExecProc` anyway. Second of all, `waitQuietly` on the `started` latch was what caused the "pipe not connected" errors: In case of InterruptedException, it caused the launcher to just continue as if `started` had already been counted down (i.e. the websocket connection established), when in reality the thread just interrupted itself because of a timeout (probably from [`DurableTaskStep.check()`][1]). [1]: https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/workflow-durable-task-step-2.13/src/main/java/org/jenkinsci/plugins/workflow/steps/durable_task/DurableTaskStep.java#L303
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for fb4d446 - Browse repository at this point
Copy the full SHA fb4d446View commit details -
Strongly inspired by [Docker Pipeline Plugin][1], but sending just a single command to the container to be faster. The command only uses linux standard tools and works on debian and alpine, so it should be sufficiently portable. Gets rid of one TODO :-). [1]: https://github.com/jenkinsci/docker-workflow-plugin/blob/45f0c04/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L249,
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for 4b607f0 - Browse repository at this point
Copy the full SHA 4b607f0View commit details -
Update Kubernetes client version as suggested by @iocanel
Seems to completely get rid of the resource leak regarding InputStreamPumper.
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for 0b08fc7 - Browse repository at this point
Copy the full SHA 0b08fc7View commit details -
InterruptedIOException when being interrupted
as suggested by @iocanel
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for dc0efee - Browse repository at this point
Copy the full SHA dc0efeeView commit details -
Use client.pods().inNamespace(namespace).withName(podName).waitUntilR…
…eady as suggested by @iocanel. Also add reference to the Jenkins issue and more context when throwing an Exception because of timeout.
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for 516ba1f - Browse repository at this point
Copy the full SHA 516ba1fView commit details -
Make number of concurrent requests to Kubernetes configurable
This solves the actual problem causing JENKINS-40825 - OkHttp limiting itself to 5 requests per hosts, which is not sufficient when running 20 builds at once. Each build uses a websocket connection for the command it runs, and additionally spawns more connections to check if the command is still running.
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for eeea0d9 - Browse repository at this point
Copy the full SHA eeea0d9View commit details -
Use kubernetes-client Config instead of reaching into client
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for 968d888 - Browse repository at this point
Copy the full SHA 968d888View commit details -
Martin Sander committed
Aug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for 15c6842 - Browse repository at this point
Copy the full SHA 15c6842View commit details -
prevent excessive string creation
if log level is not set to FINEST..
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for f0f9198 - Browse repository at this point
Copy the full SHA f0f9198View commit details -
Be more defensive about freeing resources
Although this *should* not happen, just free up the watches when the ContainerStep finishes for good measure.
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for ef93e9a - Browse repository at this point
Copy the full SHA ef93e9aView commit details -
we should be fine if we get deserialized - how are we supposed to clean up those procs in that case?
Martin Sander committedAug 9, 2017 Configuration menu - View commit details
-
Copy full SHA for a11d177 - Browse repository at this point
Copy the full SHA a11d177View commit details