ereport quality of life improvements#2225
Merged
Merged
Conversation
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In practice, so far, most ereport payloads have been defined as structs implementing `serde::Serialize` and encoded using the `minicbor-serde` adapter crate. This requires a bit of boilerplate code, so it seems worthwhile to provide a method that just does that. This commit adds one in `task-packrat-api`. It's feature-flagged so we can avoid compiling `minicbor`, `minicbor-serde`, and `serde` in tasks that don't submit ereports using this.
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports.
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
This commit changes `task-packrat-api`'s `deliver_ereport` IPC to return an error if the ereport did not fit in the buffer, rather than being infallible. In the future, this may allow some tasks to attempt re-delivery periodically until there's space.
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In practice, so far, most ereport payloads have been defined as structs implementing `serde::Serialize` and encoded using the `minicbor-serde` adapter crate. This requires a bit of boilerplate code, so it seems worthwhile to provide a method that just does that. This commit adds one in `task-packrat-api`. It's feature-flagged so we can avoid compiling `minicbor`, `minicbor-serde`, and `serde` in tasks that don't submit ereports using this.
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports.
hawkw
force-pushed
the
eliza/ereport-qol
branch
from
September 15, 2025 18:17
49710b0 to
0ff041a
Compare
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports. [1]: #2214 (comment)
hawkw
force-pushed
the
eliza/ereport-qol
branch
from
September 15, 2025 18:22
0ff041a to
dc47a60
Compare
hawkw
marked this pull request as ready for review
September 15, 2025 18:23
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports. [1]: #2214 (comment)
hawkw
force-pushed
the
eliza/ereport-qol
branch
from
September 15, 2025 18:33
dc47a60 to
e20324c
Compare
mkeeter
reviewed
Sep 15, 2025
mkeeter
reviewed
Sep 15, 2025
mkeeter
approved these changes
Sep 15, 2025
mkeeter
left a comment
Collaborator
There was a problem hiding this comment.
A few nits, but looks reasonable!
This commit changes `task-packrat-api`'s `deliver_ereport` IPC to return an error if the ereport did not fit in the buffer, rather than being infallible. In the future, this may allow some tasks to attempt re-delivery periodically until there's space.
In practice, so far, most ereport payloads have been defined as structs implementing `serde::Serialize` and encoded using the `minicbor-serde` adapter crate. This requires a bit of boilerplate code, so it seems worthwhile to provide a method that just does that. This commit adds one in `task-packrat-api`. It's feature-flagged so we can avoid compiling `minicbor`, `minicbor-serde`, and `serde` in tasks that don't submit ereports using this.
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports. [1]: #2214 (comment)
hawkw
force-pushed
the
eliza/ereport-qol
branch
from
September 15, 2025 19:19
e20324c to
c430692
Compare
hawkw
enabled auto-merge (rebase)
September 15, 2025 19:19
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
This commit changes `task-packrat-api`'s `deliver_ereport` IPC to return an error if the ereport did not fit in the buffer, rather than being infallible. In the future, this may allow some tasks to attempt re-delivery periodically until there's space.
hawkw
added a commit
that referenced
this pull request
Sep 15, 2025
In practice, so far, most ereport payloads have been defined as structs implementing `serde::Serialize` and encoded using the `minicbor-serde` adapter crate. This requires a bit of boilerplate code, so it seems worthwhile to provide a method that just does that. This commit adds one in `task-packrat-api`. It's feature-flagged so we can avoid compiling `minicbor`, `minicbor-serde`, and `serde` in tasks that don't submit ereports using this.
clockdomain
pushed a commit
to clockdomain/hubris
that referenced
this pull request
Sep 26, 2025
This commit changes `task-packrat-api`'s `deliver_ereport` IPC to return an error if the ereport did not fit in the buffer, rather than being infallible. In the future, this may allow some tasks to attempt re-delivery periodically until there's space.
clockdomain
pushed a commit
to clockdomain/hubris
that referenced
this pull request
Sep 26, 2025
In practice, so far, most ereport payloads have been defined as structs implementing `serde::Serialize` and encoded using the `minicbor-serde` adapter crate. This requires a bit of boilerplate code, so it seems worthwhile to provide a method that just does that. This commit adds one in `task-packrat-api`. It's feature-flagged so we can avoid compiling `minicbor`, `minicbor-serde`, and `serde` in tasks that don't submit ereports using this.
clockdomain
pushed a commit
to clockdomain/hubris
that referenced
this pull request
Sep 26, 2025
In [this comment][1], @cbiffle reminded me that we can use `ClaimOnceCell` to use a `static` to create byte buffers for encoding ereports. This way, the buffer is never on the stack, reducing the risk of stack overflows when recording an ereport. This commit changes `drv_gimlet_seq_server` and `drv_cosmo_seq_server` to use that technique for their ereports. [1]: oxidecomputer#2214 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch makes several improvements to the packrat ereport APIs based on experience using them. It consists of three commits that make independent changes but which depend on each other. I'd like to rebase-merge this, and the three commits can be reviewed independently in series. The changes here are:
packrat: return an error if an ereport was lost (183d155)
This commit changes
task-packrat-api'sdeliver_ereportIPC to returnan error if the ereport did not fit in the buffer, rather than being
infallible. In the future, this may allow some tasks to attempt
re-delivery periodically until there's space.
packrat: Add helper API for
serdeereports (49710b0)In practice, so far, most ereport payloads have been defined as structs
implementing
serde::Serializeand encoded using theminicbor-serdeadapter crate. This requires a bit of boilerplate code, so it seems
worthwhile to provide a method that just does that. This commit adds one
in
task-packrat-api. It's feature-flagged so we can avoid compilingminicbor,minicbor-serde, andserdein tasks that don't submitereports using this.
cpu_seq: Encode ereports into static buffers (dc47a60)
In this comment, @cbiffle reminded me that we can use
ClaimOnceCellto use astaticto create byte buffers for encodingereports. This way, the buffer is never on the stack, reducing the risk
of stack overflows when recording an ereport.
This commit changes
drv_gimlet_seq_serveranddrv_cosmo_seq_serverto use that technique for their ereports.