Skip to content
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

Simplify caching by removing the close logic #889

Merged
merged 6 commits into from
Nov 12, 2020

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Nov 9, 2020

As per
https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/#shutdown-isnt-necessary

As the kubernetes client only close the underlying client, and it is not necessary to explicitly close http clients,
it should be safe to leave as is once it is expired.

If some calling code is holding to old instances, they can still use them provided the token-based authentication still works.

Ultimately, this should prevent occurrences such as

2020-11-04 06:49:56.143+0000 [id=329776]    WARNING
i.f.k.c.d.i.WatchConnectionManager$1#onFailure: Exec Failure
java.util.concurrent.RejectedExecutionException: Task
okhttp3.RealCall$AsyncCall@556ba43e rejected from
java.util.concurrent.ThreadPoolExecutor@217680e3[Terminated, pool size =
0, active threads = 0, queued tasks = 0, completed tasks = 30]

which denote some calling code trying to make a call using an http client instance which has been closed.

As per
https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/#shutdown-isnt-necessary

As the kubernetes client only close the underlying client, and it is not necessary to explicitly close http clients,
it should be safe to leave as is once it is expired.

If some calling code is holding to old instances, they can still use them provided the token-based authentication still works.

Ultimately, this should prevent occurrences such as

2020-11-04 06:49:56.143+0000 [id=329776]    WARNING
i.f.k.c.d.i.WatchConnectionManager$1#onFailure: Exec Failure
java.util.concurrent.RejectedExecutionException: Task
okhttp3.RealCall$AsyncCall@556ba43e rejected from
java.util.concurrent.ThreadPoolExecutor@217680e3[Terminated, pool size =
0, active threads = 0, queued tasks = 0, completed tasks = 30]

which denote some calling code trying to make a call using an http client instance which has been closed.
@Vlatombe Vlatombe requested a review from jglick November 9, 2020 16:21
@jglick jglick added the bug Bug Fixes label Nov 9, 2020
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you say it is safe, then of course it would great to remove all this.

@Vlatombe Vlatombe merged commit 0c237aa into jenkinsci:master Nov 12, 2020
@Vlatombe Vlatombe deleted the simplify-client-caching branch November 12, 2020 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug Fixes
Projects
None yet
2 participants