Skip to content

Conversation

nielstenboom
Copy link
Contributor

@nielstenboom nielstenboom commented Dec 21, 2023

Hey there!

We've internally been experiencing issues with the following two issues:

#103
#107

In this PR I attempted to tackle them both by;

  • Making sure the await from exec.exec is wrapped in a try/catch so UnhandledPromiseRejection errors should no longer occur to this
  • I've wrapped the call to k8s.Exec.exec() in an exponential backoff using this package. This should mitigate the rare HttpErrors sometimes being thrown from this function.

Typescript is not my main language so apologies if things are not entirely how they should be, did my best to add some proper tests for it 💪

Please please don't hesitate to make (major) edits to this PR! I'd be very happy if that would close these issues quicker 😄

Thanks!

closes #103
closes #107

@nielstenboom nielstenboom changed the title Implement exponential retry/backoff mechanism when talking to Kubernetes API Implement exponential retry/backoff mechanism in k8s pod exec Dec 21, 2023
@nielstenboom
Copy link
Contributor Author

@nikola-jokic would you have time to look at this soon? Thanks 😄

@nikola-jokic
Copy link
Collaborator

Hey @nielstenboom,

I completely missed this PR for a very, very long time. Did you end up using this? I'm worried that retrying exec might not be the thing you always want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement retries and back off when talking to the kubernetes API Rejections from k8s.Exec.exec() are not handled
2 participants