Skip to content

fix(uffd): log error and remove stale TODO on handle failure#3132

Open
AdaAibaby wants to merge 3 commits into
e2b-dev:mainfrom
AdaAibaby:fix/uffd-handler-failure-logging
Open

fix(uffd): log error and remove stale TODO on handle failure#3132
AdaAibaby wants to merge 3 commits into
e2b-dev:mainfrom
AdaAibaby:fix/uffd-handler-failure-logging

Conversation

@AdaAibaby

@AdaAibaby AdaAibaby commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

fix #3131

The UFFD handle goroutine had a TODO comment stating that the sandbox should be killed when handle() fails. In fact, this is already implemented: u.exit.SetError() triggers the sandbox exit watcher in sandbox.go (line ~1093) which calls sbx.Stop().

  • Remove the stale TODO comment
  • Add error logging when handle() fails for better observability
  • Add unit tests covering handle failure behavior (exit error propagation, readyCh closure, handler error state, initial state, socket creation)
    /cc @jakubno Would appreciate your review on this change, thanks!

The UFFD handle goroutine had a TODO comment stating that the sandbox
should be killed when handle() fails. In fact, this is already
implemented: u.exit.SetError() triggers the sandbox exit watcher in
sandbox.go (line ~1093) which calls sbx.Stop().

- Remove the stale TODO comment
- Add error logging when handle() fails for better observability
- Add unit tests covering handle failure behavior (exit error
  propagation, readyCh closure, handler error state, initial state,
  socket creation)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds logging when the userfaultfd (uffd) handle function fails, indicating that the sandbox will be terminated, and introduces a comprehensive suite of unit tests for the uffd package. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(orchestrator): terminate sandbox when UFFD handler fails

2 participants