Skip to content

Implements sawWorkerFatal in RA InvocationEnd event.#6126

Merged
dom96 merged 1 commit intomainfrom
dominik/python-fatal-observability
Feb 24, 2026
Merged

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

Conversation

@dom96
Copy link
Copy Markdown
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
Copy Markdown

codspeed-hq bot commented Feb 20, 2026

Merging this PR will degrade performance by 16.25%

❌ 1 regressed benchmark
✅ 69 untouched benchmarks
⏩ 129 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
jsonResponse[Response] 39.9 µs 47.6 µs -16.25%

Comparing dominik/python-fatal-observability (3b8532f) with main (1a5413f)

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
Copy Markdown
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
Copy Markdown
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 2 times, most recently from 2274bab to 3d8c11a Compare February 23, 2026 11:08
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.57%. Comparing base (d0eaa7e) to head (3b8532f).
⚠️ Report is 69 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.56%   70.57%           
=======================================
  Files         409      409           
  Lines      109673   109691   +18     
  Branches    18070    18075    +5     
=======================================
+ Hits        77395    77416   +21     
+ Misses      21459    21458    -1     
+ Partials    10819    10817    -2     

☔ 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.

@dom96 dom96 force-pushed the dominik/python-fatal-observability branch from 3d8c11a to 395a831 Compare February 24, 2026 11:52
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Feb 24, 2026

@hoodmane Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@dom96 dom96 force-pushed the dominik/python-fatal-observability branch from 395a831 to 4126d11 Compare February 24, 2026 14:57
@dom96 dom96 force-pushed the dominik/python-fatal-observability branch from 4126d11 to 3b8532f Compare February 24, 2026 15:28
@dom96 dom96 merged commit abb624a into main Feb 24, 2026
22 checks passed
@dom96 dom96 deleted the dominik/python-fatal-observability branch February 24, 2026 16:31
@dom96 dom96 restored the dominik/python-fatal-observability branch February 24, 2026 16:33
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.

5 participants