-
Notifications
You must be signed in to change notification settings - Fork 19
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
Move Nexus notification to standalone task #1584
base: main
Are you sure you want to change the base?
Conversation
repair_id: reconcile_id, | ||
// surely we won't have usize::MAX extents | ||
current_item: current_task as i64, | ||
// i am serious, and don't call me shirley |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
repairs.push(DownstairsUnderRepair { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit of a shame to change this struct into a tuple, but I wouldn't block the PR for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but it is intentional; I wanted to remove Nexus-flavored types from every module except notify.rs
. We could add a new intermediate-type, but probably not worth it...
Previously, we would spawn a new
tokio::task
in theDownstairs
to do an async notification to Nexus, iff thenotify-nexus
feature was enabled. This is awkward for a few reasons:mod downstairs
notify-nexus
is enabled, which means that it's easy to have something that builds locally but fails in CIThis PR moves Nexus notifications to a separate
notify
module, which runs a single task to do these notifications in one place. It communicates to the rest of Crucible through a queue; if the queue fills up, we log and discard the notification request (since this is best-effort).All of this code is always compiled; we check the feature (using
cfg!(feature = "notify-nexus")
to determine whether it's actually enabled. This module is responsible for translating into Nexus types, so they don't leak into the rest of the codebase.