question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unexpected TaskCancelation in console

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
machtycommented, May 23, 2017

@monovertex pointed out to me a subtler case which occurs when awaiting 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.

1reaction
machtycommented, May 23, 2017

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 a someTask.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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found