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

Add executionContext/interrupt API command #3952

Merged
merged 7 commits into from
Dec 8, 2022

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Dec 7, 2022

Pull Request Description

Implement the executionContext/interrupt API command that forcibly stops the program execution.

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide build and ./run ide watch.

@4e6 4e6 self-assigned this Dec 7, 2022
.option(RuntimeOptions.LOG_LEVEL, "WARNING")
.option(
RuntimeOptions.INTERPRETER_SEQUENTIAL_COMMAND_EXECUTION,
"false"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our runtime tests are sequential, i.e. all the commands sent to the engine are executed in sequence. It is a very useful property when testing the code because it prevents all kinds of race conditions.
Unforutnately, you cannot test the program interruption with the sequential flow because you need to send an interruption command while the previous command (execute program) is still in progress. That's why there is a new suite.

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 haven't found the "forcibly stop program execution" implementation - I assume it already existed and this PR just makes it available via the protocol, right?

null;
```

#### Errors
Copy link
Contributor

Choose a reason for hiding this comment

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

probably needs an update about ContextDoesNotExist?

@4e6
Copy link
Contributor Author

4e6 commented Dec 7, 2022

I haven't found the "forcibly stop program execution" implementation - I assume it already existed

@JaroslavTulach under the hood the logic calls ThreadManager.interruptThreads() method. I assume that this is the way to interrupt the program execution.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Dec 7, 2022
@mergify mergify bot merged commit 43167c1 into develop Dec 8, 2022
@mergify mergify bot deleted the wip/db/execution-interrupt branch December 8, 2022 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants