-
Notifications
You must be signed in to change notification settings - Fork 16
More retry #236
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
More retry #236
Conversation
Moving back to a draft while I add another retry elsewhere. |
It seems to operate in its own little world and I have no idea how to make it stop when the job running it has stopped.
dbb90a6
to
7685b37
Compare
This will cover recent connections which connect directly without going through the whole setup flow. Pretty much the same logic as for listing editors but we display the errors in different ways since this all happens in a progress dialog. I tried to combine what I could in the retry. Also the SshException is misleading; it seems to wrap the real error so unwrap it otherwise it is impossible to tell what is really wrong. In particular this is causing us to retry on cancelations.
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 looks mostly OK, I just have some suggestions around refactoring for future maintainability.
import kotlin.math.min | ||
|
||
fun unwrap(ex: Exception): Throwable? { |
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.
Does Kotlin not have the equivalent of errors.Cause
?
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.
Nothing that I could find unfortunately.
src/main/kotlin/com/coder/gateway/CoderGatewayConnectionProvider.kt
Outdated
Show resolved
Hide resolved
If there is no cause we use the existing exception so this will never be null.
87ca9ed
to
a2d42d2
Compare
bdb02b0
to
2b1c082
Compare
retryIf = { | ||
it is ConnectionException || it is TimeoutException | ||
|| it is SSHException || it is DeployException |
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.
Oh, this is neat! <3
Added retry for recent connections, munged the deploy error so it is a bit more friendly, and unwrapped
SshException
since it was masking the real errors making it especially difficult to stop retrying on cancelation.