Open saikiranAnnam opened 2 weeks ago
I will be testing this thoroughly with different test cases. I might miss some other cases i have missed off.
I tested locally, the issue wasn't fixed. After I click the Stop button in the Weaver, the ongoing tasks are still ongoing. The issue is still there.
I will be testing this thoroughly with different test cases. I might miss some other cases i have missed off.
you might only test the short lived process. Try some long running tasks and try to stop them from the Weaver stop button while the workflow is running. I don't see the issue is gone. The current fix doesn't work.
You should learn more about how the Stop
button in the process history table works before fixing this issue.
I will be testing with long processes and also learn more about the stop process in the history table. And will get back on this with a new PR
This PR addresses the issue where the "Stop Workflow" button didn't properly clean up the task queue or stop tasks immediately. Key improvements include:
Immediate Task Termination: The end prematurely () method now interrupts the task’s thread (if applicable) and ensures that long-running operations are stopped promptly by checking the task’s status.
Task Queue Cleanup: When a task is stopped, the waiting and running lists are properly cleaned up. Tasks are marked as STOPPED and removed from the queues immediately.
Enhanced Monitoring: The stopMonitor() method ensures tasks on the waiting list are processed and stopped immediately.
These changes ensure that tasks are correctly cleaned up and stopped at the right moment when the stop button is pressed, improving workflow responsiveness and stability.