unexpected TaskCancelation in console
See original GitHub issueI’m seeing TaskCancelation: TaskCancelation
errors in my fastboot logs. One of the tasks causing it is:
loadIruWord: task(function * () {
let result = yield get(this, 'store').findAll('iruWord');
if (result !== null) {
let filtered = this.filterWords(result, get(this, 'adjectivesToRemove'));
set(this, 'words', filtered);
}
this.send('getIRUCount');
}).on('init'),
Normally I would look for incorrect .then()
usage, but I don’t see anything wrong with this task.
Narrowing down the task responsible, I start on the line triggering it value = new Error(TASK_CANCELATION_NAME);
and then go up the call stack to taskInstance.cancel();
in spliceTaskInstances
and taskInstance._origin._propertyName
is the task in question loadIruWord
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
c# - Unexpected task cancellation behaviour - Stack Overflow
My question is why [7] Task delay has been cancelled. is executed in the same thread where token cancellation is being requested?
Read more >Just because you stopped waiting for it, doesn't mean the Task ...
In this post I look at what happens to Tasks that are 'cancelled' using the new .NET 6 WaitAsync() API, and in other...
Read more >Task Cancellation | Microsoft Learn
A successful cancellation involves the requesting code calling the CancellationTokenSource.Cancel method and the user delegate terminating the ...
Read more >CannotPullContainer task errors - Amazon Elastic Container ...
To resolve this issue, verify the repository URI and the image name. Also make sure that you have set up the proper access...
Read more >Introduction to Cancellation in .NET - Aaron Bos
First, is the CancellationTokenSource and as you may have guessed from the name this type is the source with which an operation can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@monovertex pointed out to me a subtler case which occurs when
await
ing a task instance in an async function.Still not sure what the root cause is in @kellyselden’s case, but for everyone’s benefit I wrote up an explanatory docs page about the issue and just released a new version of EC that includes a link to this page in the TaskCancelation error text.
I’d recommend that anyone seeing these errors upgrade to the latest EC, which provides much more descriptive errors as to which task got canceled and why.
To reiterate: people should only be seeing this error if somewhere along the line, someone calls
.then()
on the TaskInstance returned from asomeTask.perform()
. Either this is your code (like in @Guaker13’s example), or it’s library code.@kellyselden you mentioned this was fastboot; perhaps you’re passing
loadIruWord.last
(or something similar) to some component (or anyone who will call.then()
) via the template, and since fastboot doesn’t know to wait for tasks to run to completion, it’s tearing down everything and canceling the task?