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 failed initialization bug in Process Monitor #4043

Merged
merged 4 commits into from
Feb 24, 2022

Conversation

SeanTAllen
Copy link
Member

Previously, when a process failed to start up, it was possible to get a report
that the process had started up and exited with the error code 0 which
normally signals success.

The problem comes from some rather poor state handling in the process package.
This commit doesn't fix the larger issue of all kinds of weirdness around state
handling but it does address the specific bug that was most likely to be
triggered in our unit tests.

The flow in its most extreme form was:

  • ProcessMonitor is created in test runner
  • Long test is setup
  • Dispose when done is setup to send dispose to ProcessMonitor
  • ProcessMonitor never successfully starts a Process so its child is _ProcessNone
  • notify gets called with failed
  • dispose is sent to the ProcessMonitor
  • ProcessMonitor extracts exit code from _ProcessNone which was 0 <-- o boy
  • "Success exit code" of 0 is passed as argument to dispose

@SeanTAllen SeanTAllen requested a review from a team February 24, 2022 02:07
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 24, 2022
Previously, when a process failed to start up, it was possible to get a report
that the process had started up and exited with the error code 0 which
normally signals success.

The problem comes from some rather poor state handling in the `process` package.
This commit doesn't fix the larger issue of all kinds of weirdness around state
handling but it does address the specific bug that was most likely to be
triggered in our unit tests.

The flow in its most extreme form was:

- ProcessMonitor is created in test runner
- Long test is setup
- Dispose when done is setup to send dispose to ProcessMonitor
- ProcessMonitor never successfully starts a Process so its child is _ProcessNone
- notify gets called with `failed`
- `dispose` is sent to the ProcessMonitor
- ProcessMonitor extracts exit code from _ProcessNone which was 0 <-- o boy
- "Success exit code" of 0 is passed as argument to `dispose`
@SeanTAllen SeanTAllen force-pushed the invalid-initialization-not-handled branch from e64941c to a358524 Compare February 24, 2022 02:08
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Feb 24, 2022
Copy link
Contributor

@mfelsche mfelsche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Oh boy!
It seems that the release notes are still empty.

@SeanTAllen
Copy link
Member Author

This is ready for another review @mfelsche.

The Windows Docker Image failures are entirely a GH issue which amusingly, from looking at the error message, I understand intimately.

@SeanTAllen SeanTAllen merged commit 1459c7c into main Feb 24, 2022
@SeanTAllen SeanTAllen deleted the invalid-initialization-not-handled branch February 24, 2022 12:17
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 24, 2022
github-actions bot pushed a commit that referenced this pull request Feb 24, 2022
github-actions bot pushed a commit that referenced this pull request Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants