Skip to content

Conversation

@krystian-panek-vmltech
Copy link
Collaborator

fixes #254

@krystian-panek-vmltech krystian-panek-vmltech marked this pull request as ready for review October 31, 2025 14:38
Copy link
Contributor

Copilot AI left a 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.


private ExecutorService jobAsyncExecutor;

private final Map<String, Boolean> jobAborted = new ConcurrentHashMap<>();
Copy link
Collaborator Author

@krystian-panek-vmltech krystian-panek-vmltech Nov 3, 2025

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

Copy link
Contributor

Copilot AI left a 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@krystian-panek-vmltech krystian-panek-vmltech merged commit 9f9abea into main Nov 3, 2025
1 check passed
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.

Implement better script abort mechanism

3 participants