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

Refactor WorkunitStore struct #10242

Merged
merged 3 commits into from Jul 7, 2020
Merged

Conversation

gshuflin
Copy link
Contributor

@gshuflin gshuflin commented Jul 2, 2020

This commit introduces a number of refactoring changes on the WorkunitStore struct:

  • rename WorkUnitInnerStore to HeavyHittersInnerStore
  • reduce the scope of a number of locks
  • eliminate the separate started/completed workunit mpsc sender/receiver pairs by wrapping the data in an enum
  • move some methods to structs with reduced scope

Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

let mut started_messages = vec![];
let mut completed_messages = vec![];

{
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

It doesn't look like the lock on self.workunit_records needs to be acquired while self.msg_rx is acquired here.

- Rename WorkUnitInnerStore
- Reduce scope of locks
- Reduce number of separate channels by using an enum
@gshuflin gshuflin merged commit fbb8712 into pantsbuild:master Jul 7, 2020
@gshuflin gshuflin deleted the refactor_workunits branch July 7, 2020 20:07
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.

None yet

2 participants