Uh oh!
There was an error while loading. Please reload this page.
feat(node): Rework ANR to use worker script via an integration - #9823
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| const { poll } = watchdogTimer(createHrTimer, options.pollInterval, options.anrThreshold, watchdogTimeout); | ||
| parentPort?.on('message', (msg: { session: Session | undefined }) => { |
There was a problem hiding this comment.
| parentPort?.on('message',(msg: {session: Session|undefined})=>{ | |
| parentPort?.on('message',(msg: {session?: Session})=>{ |
Uh oh!
There was an error while loading. Please reload this page.
| const testScriptPath = path.resolve(__dirname, 'legacy.js'); | ||
| childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (_, stdout) => { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
…nto anr-worker-from-base64-script
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
timfish
commented
Dec 19, 2023
This PR now also fetches the |
lforst
commented
Dec 20, 2023
Emitting files into our src folder is very bad for a lot of reasons - caching, build order, general reproducability. We need to change this. |
lforst
commented
Dec 20, 2023
Pls do not do this immediately as I am restructuring our rollup configs right now and I am hotfixing this but this is high prio. |
lforst
commented
Dec 20, 2023
Sorry I have to revert this PR. It has too many bad implications with the build process. |
This PR reworks Node ANR detection to use a worker thread. Workers are usually started via a path to a source file but this can cause issues when bundlers are used. Instead, the worker code is bundled and included in the source as a base64 string which can be used to launch a worker via a data URL. The base64 code comes in at around 45KB.
Closes#9324 by adding trace context.
Also aids with solving getsentry/sentry-electron#784
Relies on #9018 being merged so module and app/device context are included.Positives 👍
Negatives 👎
Usage