Skip to content

Comments

Implements sawWorkerFatal in RA InvocationEnd event.#6126

Open
dom96 wants to merge 1 commit intomainfrom
dominik/python-fatal-observability
Open

Implements sawWorkerFatal in RA InvocationEnd event.#6126
dom96 wants to merge 1 commit intomainfrom
dominik/python-fatal-observability

Conversation

@dom96
Copy link
Contributor

@dom96 dom96 commented Feb 20, 2026

Adds some observability for fatals coming out of Pyodide.

@dom96 dom96 requested review from hoodmane and ryanking13 February 20, 2026 21:30
@dom96 dom96 requested review from a team as code owners February 20, 2026 21:30
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 20, 2026

Merging this PR will not alter performance

✅ 70 untouched benchmarks
⏩ 129 skipped benchmarks1


Comparing dominik/python-fatal-observability (3d8c11a) with main (8496472)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Collaborator

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

Code Review (AI-generated by Claude)

Note: This review was generated by an AI assistant and may contain inaccuracies. Please use your judgment when evaluating these suggestions.

Overall this is a clean, well-scoped PR. The approach of injecting a JSG module for cross-boundary fatal error reporting follows established patterns in the pyodide integration. A few suggestions below, mostly around robustness of the fatal error path and preserving error context.

Summary of Findings

Priority Finding Effort
Medium Use IoContext::tryCurrent() instead of hasCurrent() + current() Trivial
Medium Guard against missing IncomingRequest in getMetrics() Small
Medium Pass error message through the reporting stack Medium
Low Clarify on_fatal upstream support Trivial
Low Add basic test coverage Medium

See inline comments for details.

Questions

  1. Is there a corresponding Pyodide-side change that makes Module.API.on_fatal actually get called? If this hook doesn't exist in the bundled Pyodide versions (0.26.0a2 / 0.28.2), the callback registration would be inert until that lands.
  2. Is sawWorkerFatal / setWorkerFatal already implemented in the internal MetricsCollector::Request? The open-source RequestObserverWithTracer in server.c++ does not override it.

Copy link
Contributor

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

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

Looks good to me. But probably we can wait until the meeting to discuss with the final design

@dom96 dom96 force-pushed the dominik/python-fatal-observability branch from 1cc6b4a to 2274bab Compare February 23, 2026 10:57
@dom96 dom96 force-pushed the dominik/python-fatal-observability branch from 2274bab to 3d8c11a Compare February 23, 2026 11:08
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.56%. Comparing base (46f1884) to head (3d8c11a).
⚠️ Report is 58 commits behind head on main.

Files with missing lines Patch % Lines
src/workerd/api/pyodide/pyodide.c++ 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6126      +/-   ##
==========================================
- Coverage   70.61%   70.56%   -0.06%     
==========================================
  Files         409      409              
  Lines      109295   109537     +242     
  Branches    18072    18039      -33     
==========================================
+ Hits        77179    77291     +112     
- Misses      21270    21440     +170     
+ Partials    10846    10806      -40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants