mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
Temporary instrumentation to diagnose the ScriptTerminatedError that appears in single-threaded mode after the mini_racer 0.21.0 -> 0.21.3 upgrade (e.g. spec/system/table_builder_spec.rb, raised from PrettyText.cook during fab!/create_post setup). Local reproduction shows no genuine 25s slowdown: idle cooks are ~19ms on both versions, and the per-callback regression in single-threaded mode (0.21.1+ routes js->ruby callbacks through the dedicated runner thread instead of inline, ~30x slower per callback) is nowhere near enough to hit the 25s watchdog. The open question is whether CI is hitting the watchdog at all, or whether the cook is being aborted instantly — 0.21.3 wires an rb_nogvl unblock function that calls v8_terminate_execution on any interrupt, where 0.21.0 passed a NULL ubf and deferred interrupts until the eval finished. This prepends to MiniRacer::Context and, on every ScriptTerminatedError, logs the elapsed time of that eval/call (≈25000ms => real watchdog timeout; tiny => instant abort) plus a backtrace snapshot of every live thread, and logs stop/dispose so a concurrent terminator on the shared context is visible. Verified locally: transparent to normal cooks, fires on forced termination. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| environments | ||
| initializers | ||
| locales | ||
| application.rb | ||
| boot.rb | ||
| cdn.yml.sample | ||
| database.yml | ||
| deploy.rb.sample | ||
| dev_defaults.yml | ||
| discourse.config.sample | ||
| discourse.pill.sample | ||
| discourse_defaults.conf | ||
| environment.rb | ||
| logrotate.conf | ||
| multisite.yml.production-sample | ||
| nginx.sample.conf | ||
| official_plugins.json | ||
| pitchfork.conf.rb | ||
| projections.json | ||
| routes.rb | ||
| sidekiq.yml | ||
| site_settings.yml | ||
| spring.rb | ||
| thin.yml.sample | ||
| unicorn_launcher | ||