Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zinnia sentry grouping #446

Merged
merged 5 commits into from
May 9, 2024
Merged

Fix zinnia sentry grouping #446

merged 5 commits into from
May 9, 2024

Conversation

juliangruber
Copy link
Member

The problem was if (!signal.aborted): We only performed the special Sentry error transformation when a child process exited on its own. When the AbortController was triggered (say because there was a module update), then signal.aborted was always true, and therefore the special Sentry code didn't run.

This condition was a mistake, and is now removed in this PR. We want to run the code block on every child process exit.

@juliangruber juliangruber requested a review from bajtos May 3, 2024 11:56
@bajtos
Copy link
Member

bajtos commented May 3, 2024

The problem was if (!signal.aborted): We only performed the special Sentry error transformation when a child process exited on its own. When the AbortController was triggered (say because there was a module update), then signal.aborted was always true, and therefore the special Sentry code didn't run.

This condition was a mistake, and is now removed in this PR. We want to run the code block on every child process exit.

This doesn't sound right to me. IIUC, with your change in place, we will report module exits to Sentry, even in situations when the exit was expected because it was triggered by us.

IMO, we should implement the following behaviour:

  • When the child process exits on its own, we want to report the error to Sentry.
  • When the child process exits because we are aborting, no error should be reported to Sentry.

I think the following change would achieve that:

-    if (!signal.aborted) {
+    if (signal.aborted) {
+      Object.assign(err, { reportedToSentry: true })
+    } else {

WDYT?

In this case, your original name, shouldReportToSentry, would work better than the name reportedToSentry I proposed. 🙈

@juliangruber
Copy link
Member Author

The problem was if (!signal.aborted): We only performed the special Sentry error transformation when a child process exited on its own. When the AbortController was triggered (say because there was a module update), then signal.aborted was always true, and therefore the special Sentry code didn't run.
This condition was a mistake, and is now removed in this PR. We want to run the code block on every child process exit.

This doesn't sound right to me. IIUC, with your change in place, we will report module exits to Sentry, even in situations when the exit was expected because it was triggered by us.

IMO, we should implement the following behaviour:

  • When the child process exits on its own, we want to report the error to Sentry.
  • When the child process exits because we are aborting, no error should be reported to Sentry.

I think the following change would achieve that:

-    if (!signal.aborted) {
+    if (signal.aborted) {
+      Object.assign(err, { reportedToSentry: true })
+    } else {

WDYT?

In this case, your original name, shouldReportToSentry, would work better than the name reportedToSentry I proposed. 🙈

Great catch! Implemented as suggested, and made the detection for abort errors more robust (we want to know where this caught error is from an abort, not whether an abort has happened in general). Also, don't worry about the shouldReportToSentry name, this situation was impossible to predict.

@bajtos bajtos enabled auto-merge (squash) May 9, 2024 06:19
@bajtos bajtos disabled auto-merge May 9, 2024 06:21
@juliangruber juliangruber merged commit 0bf6a6d into main May 9, 2024
18 checks passed
@juliangruber juliangruber deleted the fix/zinnia-sentry branch May 9, 2024 16:23
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.

2 participants