-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix terminating thread kube #3610
Conversation
…umber of records and always works.
…It also waits for the pod to be ready before doing anything else. Sync worker will also remove the pod on termination.
…rbyte into davinchia/kube-queueing-poc
…elete command in Sync worker.
…rbyte into davinchia/kube-queueing-poc
…rbyte into davinchia/kube-queueing-poc
* nearly working sources * update * stdin example
…t the airbyte-workers resource folder; place all the poc yamls together.
…es to Dest pod after refactor.
…ot seem to be passing in.
…rbyte into davinchia/kube-queueing-poc
also clean up kubernetes deploys.
…getting the right entrypoint.
@@ -95,9 +99,10 @@ public static void main(String[] args) throws InterruptedException, IOException | |||
// https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/#shutdown-isnt-necessary | |||
// Instead, the pod shuts down after 5 minutes as the pool reaps the remaining idle connection after | |||
// 5 minutes of inactivity, as per the default configuration. | |||
KUBE_CLIENT.close(); | |||
OK_HTTP_CLIENT.dispatcher().cancelAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this had no impact
@@ -95,9 +99,10 @@ public static void main(String[] args) throws InterruptedException, IOException | |||
// https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/#shutdown-isnt-necessary | |||
// Instead, the pod shuts down after 5 minutes as the pool reaps the remaining idle connection after | |||
// 5 minutes of inactivity, as per the default configuration. | |||
KUBE_CLIENT.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reordering had no impact
// Explicitly create the underlying HTTP client since the Kube client has issues with closing the | ||
// client. It is not clear in which library the fault | ||
// lies. See https://github.com/fabric8io/kubernetes-client/issues/2403. | ||
final Config CONFIG = new ConfigBuilder().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
making it non-static had no impact
// client. It is not clear in which library the fault | ||
// lies. See https://github.com/fabric8io/kubernetes-client/issues/2403. | ||
final Config CONFIG = new ConfigBuilder().build(); | ||
final OkHttpClient OK_HTTP_CLIENT = HttpClientUtilsAirbyte.createHttpClient(CONFIG); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only piece that had impact
nice! was thinking this is the 'best' way to do so. I'm thinking we use |
I'd actually prefer to clean this up slightly merge this in with a big comment linking to an issue and a fabric8 change. It looks like if it were accepted it'd take up to a month to get in place. We're going to need proper termination in a week. Either that or I think we'd need to wrap everything in our main loop with a try catch that Either way I'll make the PR for fabric8 in the morning in hopes to get that into their next release ASAP. |
Makes sense. I'll create an issue for us and Fabric and use the system.exit version in the mean time. I'm going to start using the cloud tag. |
Definitely not mergable, but I wanted to demonstrate one way we can do this.
HttpClientUtilsAirbyte
is a clone ofio.fabric8.kubernetes.client.utils.HttpClientUtils
except with the inclusion of the following line:Since it specifies that we can't keep idle connections around it will incur a small performance hit on the kube api server, but it would fix this problem for now at least. We could also allow idle connections but move the keep alive down to 1s/500ms/similar.
I tried just using
but even in Docker for Desktop Kube it fails because it doesn't have all of that SSL configuration.
I bet there's an
OkHttp
client builder somewhere that is serviceable by default.