Conversation
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
There was a problem hiding this comment.
🟡 Changes recommended
Snapshot compatibility, tracing cache invalidation, guest protocol support, and test/documentation follow-ups remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Justfile:246
- The new ignored test is added to
test-isolated, butcoverage-runhas its own explicit isolated-test list and still only invokesmax_guest_log_level_is_honored_from_snapshot. Since ignored tests are not selected by the broad test commands, the initialized-snapshot override behavior is omitted from coverage. Add the corresponding command to the coverage recipe.
{{ cargo-cmd }} test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" { "dev" } else { target } }} {{ target-triple-flag }} -p hyperlight-host --lib -- sandbox::initialized_multi_use::tests::from_snapshot::max_guest_log_level_overrides_initialized_snapshot --exact --ignored
src/hyperlight_host/src/sandbox/initialized_multi_use.rs:633
- The pending value is consumed only by
refresh_guest_log_levelin the guest binary. An initialized snapshot contains the guest code that was captured, so snapshots made before this protocol, or with a guest build that lacks it, never consume this slot. Because the snapshot ABI and loader acceptance are unchanged, this path silently reports success while the override has no effect. Add a compatibility/version gate or another mechanism that guarantees the restored guest supports the protocol.
if let Some(log_level) = self.max_guest_log_level {
self.mem_mgr.request_guest_log_level_update(log_level)?;
src/hyperlight_host/src/sandbox/initialized_multi_use.rs:151
- This adds the public
MultiUseSandbox::log_levelAPI and changes snapshot-builder behavior, butCHANGELOG.mdhas no entry for the feature underUnreleased. Add a concise user-facing changelog entry before merging.
/// Sets the maximum log level used by future guest calls.
///
/// The setting is reapplied after restoring a snapshot.
pub fn log_level(&mut self, log_level: LevelFilter) -> Result<()> {
- Files reviewed: 12/12 changed files
- Comments generated: 4
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Critical logging and snapshot-golden compatibility issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
src/hyperlight_guest_tracing/src/lib.rs:77
- When the requested level is
OFFand no subscriber exists, this fallback still initializes guest tracing.generic_initdeliberately skips tracing forOFF(hyperlight_guest_bin/src/lib.rs:300-306), whileGuestHandle::log_messageusesis_trace_enabled()to choose the direct output path. Initializing anOFFsubscriber makes that check true and causes directguest_logger::log_messagecalls to be dropped byGuestSubscriber::enabledinstead of sent to the host. Keep tracing uninitialized forOFFwhen there is no existing subscriber, while still updating an existing subscriber toOFF.
} else {
init_guest_tracing(guest_start_tsc, max_log_level);
- Files reviewed: 15/15 changed files
- Comments generated: 2
- Review effort level: Lite
ludfjig
left a comment
There was a problem hiding this comment.
Looks great. I think we can update docs/hyperlight-metrics-logs-and-traces.md as well
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
568c1be to
2f4e5d0
Compare
ludfjig
left a comment
There was a problem hiding this comment.
looks good the only thing I'm uncertain about is whether bumping the snapshot version is really necessary. What could go wrong if we don't bump any versions, and load an old snapshot with these changes?
|
I think on that case we could risk overriding the exception stack with log level information, right? |
|
Here's the comment that resulted in the version bump: #1833 (comment) |
Closes #1698
Adds guest log-level overrides for initialized snapshots.
Changes
logand tracing filters before guest calls.MultiUseSandbox::log_level.restore().Validation