If the current task is stuck for too long after being canceled it's probably stuck forever. Let "too long" be 10 seconds. And let it get stuck forever in debug build only.