-
Notifications
You must be signed in to change notification settings - Fork 3
Graceful aborting #255
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
Graceful aborting #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements graceful execution abort functionality with configurable timeout. The implementation allows code executions to be aborted gracefully by checking abort status during execution, with a fallback to forceful termination if the timeout is exceeded.
- Introduces
context.checkAborted()method for scripts to enable graceful termination - Adds configurable abort timeout with graceful and forceful termination modes
- Updates UI to inform users about the abort behavior and the need to call
context.checkAborted()
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ExecutionAbortButton.tsx | Updated dialog messages to explain graceful abort mechanism and the requirement to call context.checkAborted() |
| demo_processing.yml | Added example usage of context.checkAborted() in demo script |
| ExceptionUtils.java | Added utility method to get root cause of exceptions |
| ExecutionQueue.java | Implemented abort timeout logic with graceful and forceful termination modes |
| ExecutionContext.java | Added isAborted() and checkAborted() methods, exposed context variable to scripts |
| ExecutionAbortException.java | New exception class for graceful abort signaling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/dev/vml/es/acm/core/code/ExecutionContext.java
Outdated
Show resolved
Hide resolved
core/src/main/java/dev/vml/es/acm/core/code/ExecutionAbortException.java
Outdated
Show resolved
Hide resolved
core/src/main/java/dev/vml/es/acm/core/code/ExecutionQueue.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| private ExecutorService jobAsyncExecutor; | ||
|
|
||
| private final Map<String, Boolean> jobAborted = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jobManager.stopByJobId() does not make job.getJobState() == STOPPED but .. ACTIVE remains :(
only makes internal flag JobExecutionContext.isStopped() true
that's why I need to track/expose it on my own
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fixes #254