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

System.exit does proper context hard exit. #10363

Merged
merged 12 commits into from
Jul 18, 2024

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Jun 25, 2024

Fixes #9872

Pull Request Description

The System.exit 42 component is treated the same way as any other Panic error - it does not interfere with other component evaluation:
image

After removing the System.exit 42 component, the workflow works as expected. I have also tried opening the project with the component and then removing it.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Unit tests have been written where possible.
  • Try to insert System.exit in a workflow in IDE and make sure it is usable after that.

@Akirathan Akirathan added the CI: No changelog needed Do not require a changelog entry for this PR. label Jun 25, 2024
@Akirathan Akirathan self-assigned this Jun 25, 2024
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

  • The ExitException should implement getExceptionExitStatus
  • I'd like to understand what is the benefit of using ctx.exit over (improved) ExitException

Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I believe ProgramExcecutionSupport shouldn't depend on the instanceof to detect "exit exception". Best to make the ExitException package private to enforce that.

@@ -880,8 +880,12 @@ private void runMain(
}
}
} catch (PolyglotException e) {
printPolyglotException(e, rootPkgPath);
throw exitFail();
if (e.isExit()) {
Copy link
Member

Choose a reason for hiding this comment

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

Possibly we might close the context here to notify other language runtimes that the shutdown is happening... not very urgent.

@Akirathan Akirathan added the CI: Ready to merge This PR is eligible for automatic merge label Jul 18, 2024
@mergify mergify bot merged commit 451d7cb into develop Jul 18, 2024
42 checks passed
@mergify mergify bot deleted the wip/akirathan/9872-system-exit branch July 18, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.exit makes GUI unable to initialize the project - don't exit the sandbox!
4 participants