You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RFE: Cancel running Koji tasks on process restart #79
ELNBuildSync saves all of its active tasks in a database table, so if it crashes or is restarted for any reason (including process upgrade), it will start any currently-running batch over from the beginning. It can do this reasonably safely because it performs Koji draft builds and only promotes them to stable immediately prior to submitting them as a Bodhi update.
However, this means that any tasks that were running prior to the restart will keep going in Koji, tying up a builder and wasting resources on a build that will never be promoted.
Therefore, I think it is probably sensible that the startup process of EBS (before it begins processing any pending requests) should cancel any running Koji tasks that were started by the EBS user.
The workflow would look something like:
EBS starts up and starts the logger and initiates its mainloop
EBS downloads its dynamic configuration
EBS gets the current user ID with session.getLoggedInUser()
It actually does (I was just checking). session.listTasks() doesn't have a way to get just the parent tasks and walking the relationship just to avoid individually canceling the children seems like unnecessary effort. Better to just cancel them all (with recurse=False).
Activity
yselkowitz commentedon Sep 16, 2026
Just note that (at least theoretically) only the parent tasks need to be cancelled directly, unless that makes things more complicated.
sgallagher commentedon Sep 16, 2026
It actually does (I was just checking).
session.listTasks()doesn't have a way to get just the parent tasks and walking the relationship just to avoid individually canceling the children seems like unnecessary effort. Better to just cancel them all (withrecurse=False).