Skip to content
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

Wait for instance tasks before shutting down Cluster #423

Merged
merged 4 commits into from
Jun 1, 2021

Conversation

azawlocki
Copy link
Contributor

@azawlocki azawlocki commented Jun 1, 2021

Resolves #422

#422 is caused by asyncio tasks that run Cluster.spawn_instance() being left running in the background when their Cluster and Golem instances shut down. In particular, part of Golem shutdown process is closing API clients which may still be used by those instance tasks (to destroy an activity and terminate an agreement, etc.).

This PR modifies Cluster.__aexit__() to wait until those tasks terminate (and cancel them, if they don't terminate within 10s).

Also included is a fix for the "ugly traceback" part of golemfactory/yagna-triage#119: when shutting down Golem, we cancel the job that waits for incoming invoices after 30s.

@azawlocki azawlocki requested a review from a team June 1, 2021 13:20
@azawlocki azawlocki force-pushed the az/wait-for-instance-tasks branch from edfd63e to 378449b Compare June 1, 2021 13:21
Copy link
Contributor

@kmazurek kmazurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@azawlocki azawlocki merged commit fefd789 into master Jun 1, 2021
@azawlocki azawlocki deleted the az/wait-for-instance-tasks branch June 1, 2021 20:29
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.

Unretrieved exception printed when Service API exits
3 participants