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

Hubris-side changes for removing dispatch_n in idol-runtime #1632

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

cbiffle
Copy link
Collaborator

@cbiffle cbiffle commented Feb 26, 2024

This is the Hubris part of oxidecomputer/idolatry#39, the description of which I've pasted below for your reference:


We ran into an issue last week where we inadvertently replaced a call to idol_runtime::dispatch_n with a call to idol_runtime::dispatch. This difficult-to-spot two-character change has the following implications:

  1. No warnings or errors are produced.
  2. Notifications to the server are silently ignored.

This is bad, and caused real failures in host startup.

This change alters the API to eliminate dispatch_n and make notification handling mandatory for all Idol servers -- to opt out of receiving notifications, they must explicitly implement NotificationHandler as stubs. This should prevent this class of error from reoccurring, and has the added benefit of simplifying the runtime implementation -- which I'd previously complicated in a misguided attempt at ergonomics.

@cbiffle cbiffle force-pushed the cbiffle/idol-footgun branch 2 times, most recently from 94fed52 to cfdaa4f Compare February 26, 2024 20:13
@cbiffle cbiffle marked this pull request as ready for review February 26, 2024 20:15
Copy link
Collaborator

@labbott labbott left a comment

Choose a reason for hiding this comment

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

Part of me wishes there was something like derive(DefaultNotification), maybe future work

@hawkw
Copy link
Member

hawkw commented Feb 27, 2024

Looks like we're missing an impl of NotificationHandler for drv_fpga_server::ServerImpl , and gimlet_seq_server still calls idol_runtime::dispatch_n.

@cbiffle cbiffle force-pushed the cbiffle/idol-footgun branch 3 times, most recently from 7ee03ea to 55be7bc Compare February 27, 2024 21:35
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

🚫🦶🔫

@hawkw
Copy link
Member

hawkw commented Feb 27, 2024

oh, ugh, looks like you're missing one in dump-agent too.

This is the Hubris side of
oxidecomputer/idolatry#39 and is intended to
make it much harder to accidentally lose notifications in an Idol
server.
@cbiffle cbiffle merged commit 7b26e58 into master Feb 27, 2024
83 checks passed
@cbiffle cbiffle deleted the cbiffle/idol-footgun branch February 27, 2024 22:27
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

3 participants