Skip to content

Use runner internal secondary shutdown for runner tasks to avoid deadlock#2799

Open
theodorebugnet wants to merge 1 commit intodevfrom
theodore/shutdown-hang-contention
Open

Use runner internal secondary shutdown for runner tasks to avoid deadlock#2799
theodorebugnet wants to merge 1 commit intodevfrom
theodore/shutdown-hang-contention

Conversation

@theodorebugnet
Copy link
Copy Markdown
Contributor

Description

The runner uses an internal secondary shutdown receiver, and when the stop height is reached, the loop in run_in_process() breaks and sends a signal to the secondary channel; the runner then awaits all of its background handles. Two of the background tasks were not listening to this secondary shutdown: sync status updater and finalized block prefetcher. So if these tasks were running and busy, the runner could get into a deadlock and hang indefinitely.

This PR changes them to listen to the secondary channel, so they get cleaned up whenever the runner signals shutdown. It also adds a test which successfully deadlocks if the changes in runner.rs are reverted.

  • I have updated CHANGELOG.md with a new entry if my PR makes any breaking changes or fixes a bug. If my PR removes a feature or changes its behavior, I provide help for users on how to migrate to the new behavior.
  • I have carefully reviewed all my Cargo.toml changes before opening the PRs. (Are all new dependencies necessary? Is any module dependency leaked into the full-node (hint: it shouldn't)?)

Linked Issues

  • Fixes # (issue, if applicable)
  • Related to # (issue)

Testing

Describe how these changes were tested. If you've added new features, have you added unit tests?

Docs

Describe where this code is documented. If it changes a documented interface, have the docs been updated?

Rendered docs are available at https://sovlabs-ci-rustdoc-artifacts.us-east-1.amazonaws.com/<BRANCH_NAME>/index.html

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.

1 participant