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

tower-batch: wake waiting workers on close to avoid hangs #1908

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

yaahc
Copy link
Contributor

@yaahc yaahc commented Mar 15, 2021

Motivation

After upgrading tower to use tokio 0.3 the tower maintainers noticed they'd introduced a regression where tasks could fail to get woken up when the background task of a Buffer closed. They've since fixed this regression in tower-rs/tower#480. Well before this change we copied Buffer into our codebase as the basis of tower-batch. Our implementation has this same bug now.

Solution

To fix this we just need to apply the same fix they did to our implementation, properly notifying semaphore waiters when we drop or close.

The code in this pull request has:

  • Documentation Comments
  • Unit Tests and Property Tests

Review

@teor2345 originally identified this issue

Related Issues

#1805

Follow Up Work

@zfnd-bot zfnd-bot bot assigned yaahc Mar 15, 2021
@teor2345 teor2345 self-requested a review March 15, 2021 23:20
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks so much for adding the tests!

@teor2345 teor2345 changed the title Jane/tower batch fix tower-batch: wake waiting workers on close to avoid hangs Mar 17, 2021
@teor2345 teor2345 merged commit fc4b8c1 into main Mar 17, 2021
@teor2345 teor2345 deleted the jane/tower-batch-fix branch March 17, 2021 00:44
@dconnolly dconnolly mentioned this pull request Mar 23, 2021
23 tasks
dconnolly added a commit that referenced this pull request Mar 23, 2021
Zebra's latest alpha checkpoints on Canopy activation, continues our work on NU5, and fixes a security issue.

Some notable changes include:

## Added
- Log address book metrics when PeerSet or CandidateSet don't have many peers (#1906)
- Document test coverage workflow (#1919)
- Add a final job to CI, so we can easily require all the CI jobs to pass (#1927)

## Changed
- Zebra has moved its mandatory checkpoint from Sapling to Canopy (#1898, #1926)
  - This is a breaking change for users that depend on the exact height of the mandatory checkpoint.

## Fixed
- tower-batch: wake waiting workers on close to avoid hangs (#1908)
- Assert that pre-Canopy blocks use checkpointing (#1909)
- Fix CI disk space usage by disabling incremental compilation in coverage builds (#1923)

## Security
- Stop relying on unchecked length fields when preallocating vectors (#1925)
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