Skip to content

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

Merged
merged 8 commits into from
May 2, 2023
Merged

More retry #236

merged 8 commits into from
May 2, 2023

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Apr 27, 2023

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.

@code-asher code-asher requested a review from johnstcn April 27, 2023 19:52
@code-asher code-asher marked this pull request as draft April 27, 2023 22:14
@code-asher
Copy link
Member Author

Moving back to a draft while I add another retry elsewhere.

@code-asher code-asher changed the title Retry on another exception More retry Apr 28, 2023
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.
@code-asher code-asher force-pushed the more-retry branch 3 times, most recently from dbb90a6 to 7685b37 Compare April 28, 2023 01:54
@code-asher code-asher marked this pull request as ready for review April 28, 2023 02:02
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.
Copy link
Member

@johnstcn johnstcn left a 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? {
Copy link
Member

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?

Copy link
Member Author

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.

code-asher added 2 commits May 1, 2023 13:45
If there is no cause we use the existing exception so this will never be
null.
@code-asher code-asher force-pushed the more-retry branch 3 times, most recently from 87ca9ed to a2d42d2 Compare May 1, 2023 23:52
@code-asher code-asher force-pushed the more-retry branch 2 times, most recently from bdb02b0 to 2b1c082 Compare May 2, 2023 00:43
Comment on lines +48 to +50
retryIf = {
it is ConnectionException || it is TimeoutException
|| it is SSHException || it is DeployException
Copy link
Member

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

@code-asher code-asher merged commit 76f92ed into main May 2, 2023
@code-asher code-asher deleted the more-retry branch May 2, 2023 21:34
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.

2 participants