Add a property to disable client object caching #1187
Draft
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.
In a high frequency cronjob (running every 2min) seeing after about ~2.5h the connections are getting stuck at
com.nirima.jenkins.plugins.docker.DockerCloud.countContainersInDocker, and since that, no new builds using the agent from this docker cloud would work.Restarting the jenkins controller again makes the builds start working.
Indicating a stuck socket connection, possible fix is in supporting
SO_TIMEOUT> 0 at https://github.com/docker-java/docker-java/blob/faa88e16460a8cb321c9695cdbc34cb7a662458e/docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5/ApacheDockerHttpClientImpl.java#L117-L122It would be working if each build is separated by at least 5 minute, so the cache could expire, as,
docker-plugin/src/main/java/io/jenkins/docker/client/DockerAPI.java
Line 191 in 560b370
docker-plugin/src/main/java/io/jenkins/docker/client/UsageTrackingCache.java
Lines 63 to 64 in 560b370
thread dump
This PR is experimenting with disabling the cache.
Testing done
Simulated zombie connection by,
node('docker') { sh 'sleep 120' }sudo iptables -A OUTPUT -p tcp -d 10.112.7.2 --sport 2375 -j DROP(here the IP of jenkins controller is10.112.7.2)sudo systemctl stop dockerAfter the patch
Submitter checklist