Closed Column01 closed 3 months ago
I can't for the life of me figure out why this happens, sometimes it works fine to cancel a restart and other times it doesn't work at all
Shutdown's self.cancel
doesn't get adjusted when one of the delayed events actually happens. That seems like a bug, and it could be the root cause of this.
Ahh I see, this seems to be the case. I can probably work something out where if it tries to cancel an ready completed event it just goes back and tries the next queue item until it either cancels something or the queue is empty
If a server restarts multiple times those cancel events potentially build up over time too as far as I can tell. Might need to implement something that clears the queue of completed events instead of the other idea
Shutdown's
self.cancel
doesn't get adjusted when one of the delayed events actually happens. That seems like a bug, and it could be the root cause of this.
I know this is kind of old at this point but I'm looking into it and the actual error comes here
Am I stupid to think I could just fix this by checking if the task is active before trying to cancel it? Or should I be looking at fixing what you mentioned where the events are not cleared in shutdown. Cause it seems to me this could happen for any task that is being run in a plugin that can be cancelled
def cancel(*args):
if delayed_call[0].active():
delayed_call[0].cancel()
if callbackCancel:
callbackCancel(*args)
I was correct in my assumption, should push a fix here in a bit