Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Worker: do not report the task as failed if it's context was canceled #654

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

edigaryev
Copy link
Contributor

Unfortunately, golang.org/x/crypto/ssh does not support context.Context and when we close *ssh.Client in the monitor's snippet due to context cancellation, we can get pretty much all sorts of random errors, depending on which stage the SSH connection was in, but we won't get the context.Canceled which we already try to filter out.

I think the simplest way to work around this is to additionally check if we've actually canceled the context, and if so — ignore the error from the underlying code.

@edigaryev edigaryev requested a review from fkorotkov September 29, 2023 09:21
@edigaryev edigaryev enabled auto-merge (squash) September 29, 2023 09:29
@edigaryev edigaryev merged commit 884ca5c into master Sep 29, 2023
6 of 7 checks passed
@edigaryev edigaryev deleted the worker-context-canceled branch September 29, 2023 09:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants