ESIPFed / Geoweaver

boost data pipeline's tangibility, enhance research productivity, reduce work anxiety
https://geoweaver.dev
MIT License
81 stars 44 forks source link

Fix: Improve Task Cleanup and Immediate Termination in Workflow Stop (#573) #581

Open saikiranAnnam opened 2 weeks ago

saikiranAnnam commented 2 weeks ago

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.

saikiranAnnam commented 1 week ago

I will be testing this thoroughly with different test cases. I might miss some other cases i have missed off.

ZihengSun commented 1 week ago

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.

ZihengSun commented 1 week ago

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.

ZihengSun commented 1 week ago

You should learn more about how the Stop button in the process history table works before fixing this issue.

saikiranAnnam commented 1 week ago

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