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

Simplify the do_work_task loop #1150

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Feb 7, 2024

  • Use a VecDeque to remove the inner / outer loops
  • Clarify that the is_lossy conditional helps exercise reordering / dependency tracking
  • Use the let Some(v) = v else { continue; }; pattern to reduce rightward indentation creep
  • Move the logic from check_message_for_abort next to the code that actually handles errors + replying

This is mostly indentation changes by volume; sorry that the Github UI is Very Mad about it.

@mkeeter mkeeter requested a review from leftwo February 7, 2024 17:10
Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

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

Yeah, looks good. Just a comment but no changes.

is_flush,
)
.await?;
cdt::work__process!(|| job_id.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought maybe this probe was in a bad spot, as we could hit this, then
fal out of the loop if some other downstairs was promoted at line 1057,
but, if that really is the case, then the whole accounting is meaningless
as we should be shutting this task down with the other upstairs takes over.

Also, this issue was here before you refactored.

@mkeeter mkeeter merged commit 2d7e499 into oxidecomputer:main Feb 7, 2024
18 checks passed
@mkeeter mkeeter deleted the refactor-do-work branch February 7, 2024 18:55
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