-
Notifications
You must be signed in to change notification settings - Fork 45
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
Stop workflow doesn't clean up the task queue #573
Comments
To address the issue (#573 ) where workflows with only two processes fail to execute properly, we can adjust the notifyWaitinglist method to handle cases with minimal waiting list sizes more effectively. Explanation of changes :
Proposal Logic Fixture:
Code Adjustments:src/main/java/com/gw/tasks/TaskManager.java public synchronized void notifyWaitinglist() {
logger.debug("notify waiting list to pay attention to the released worker");
if (waitinglist.size() > 0 && wm.getCurrentWorkerNumber() < worknumber) {
orderWaitingList(); // Ensure highest-priority tasks are first
Iterator<Task> iterator = waitinglist.iterator();
while (iterator.hasNext()) {
GeoweaverProcessTask newtask = (GeoweaverProcessTask) iterator.next();
if (newtask.getIsReady()) {
iterator.remove(); // Safely remove task using iterator
if (newtask.checkShouldPassOrNot()) {
newtask.endPrematurely();
notifyWaitinglist(); // Recursively call to handle remaining tasks
break; // Break to prevent ConcurrentModificationException
} else {
executeATask(newtask);
break; // Exit to allow notifyWaitinglist to run again
}
}
}
}
} These logic adjustments and proposal fixtures ensure that each task is given attention immediately after another finish. When only two processes are in the list, this ensures that both are processed in sequence without skipping or interference due to concurrent modifications. Note: This is a proposed fix to address the issue. I am open to suggestions and have not yet tested it. |
Is the old function (i.e notify function before this logic proposal) still working properly, or does it continue to show the same error related to credentials or host configuration? The error indicates a credentials issue or a host configuration problem. |
Yeah the old function was able to run the workflow and doesn't give any log on error. |
If you hit stop button in Weaver, the rest of the tasks will still be triggered. They should all be cleaned up. The ongoing tasks should be stopped instantly.
The text was updated successfully, but these errors were encountered: