You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After enabling ANR detection for the main process, all Electron processes are spawned twice #784
After enabling ANR detection for the main process, all Electron processes are being repeatedly created.
This ANR detection relies on the sentry/node ANR module, which checks and spawns a child process during application startup. However, this approach is causing other child processes to be duplicated in Electron.
changed the title [-]There[/-][+]After enabling ANR detection for the main process, all Electron processes are being repeatedly created[/+]on Nov 6, 2023
changed the title [-]After enabling ANR detection for the main process, all Electron processes are being repeatedly created[/-][+]After enabling ANR detection for the main process, all Electron processes are spawn twice[/+]on Nov 6, 2023
changed the title [-]After enabling ANR detection for the main process, all Electron processes are spawn twice[/-][+]After enabling ANR detection for the main process, all Electron processes are spawned twice[/+]on Nov 6, 2023
The ANR monitoring was a feature we eagerly want to have.
Big thanks to the team effort that made that happen! However we also got a blocking issue.
I hope that you can help facilitate the priority for this fix.
@sentry/node now uses a worker thread rather than a child process. Once we get the Electron SDK using the latest JavaScript SDKs this upgrade should be supported in Electron too.
Activity
[-]There[/-][+]After enabling ANR detection for the main process, all Electron processes are being repeatedly created[/+][-]After enabling ANR detection for the main process, all Electron processes are being repeatedly created[/-][+]After enabling ANR detection for the main process, all Electron processes are spawn twice[/+][-]After enabling ANR detection for the main process, all Electron processes are spawn twice[/-][+]After enabling ANR detection for the main process, all Electron processes are spawned twice[/+]fredyangRC commentedon Nov 7, 2023
The ANR monitoring was a feature we eagerly want to have.
Big thanks to the team effort that made that happen! However we also got a blocking issue.
I hope that you can help facilitate the priority for this fix.
Thanks,
Fred
lforst commentedon Nov 8, 2023
Thanks for reporting this. We will take a look!
timfish commentedon Nov 15, 2023
How are you starting other child processes? I looked at the demo repo and couldn't find anything obvious.
Ah ok, looking at the screenshot, there are multiple Electron processes?
beyondkmp commentedon Nov 16, 2023
Yes, there are two electron instance. Then there are duplicate network/gpu/crashpad process.
beyondkmp commentedon Nov 22, 2023
@timfish
We need to add
ELECTRON_RUN_AS_NODE =1env option in this line(https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/anr/index.ts#L106), then this anr process is just a node process instead of multiple electron process.After adding this environment variable, the icon on the macOS dock no longer flashes. This code(#777) can be removed.
timfish commentedon Nov 24, 2023
There are issues with using a node process for ANR, rather than another electron main process:
electronwhich will fail in node mode.appname@versionrelease name.I'll be back from vacation shortly and I'll be able to look into this further.
timfish commentedon Dec 24, 2023
@sentry/nodenow uses a worker thread rather than a child process. Once we get the Electron SDK using the latest JavaScript SDKs this upgrade should be supported in Electron too.timfish commentedon Jan 5, 2024
This was closed by #810 and will be in the next release.