-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaskInstance '__DS_COPY_TASK_RUNNER__' was canceled because it belongs to a 'drop' Task that was already running. #7
Comments
I tried to replace .copy with manual (create record + calling all setters) copping and it went with no error. Also tried to get some info from ember slack, here is response, but not sure if it helps : it’s hard to say without seeing some of the code, but that’s an error that will result from a promise rejection after a task instance has been coerced to a promise (usually by calling |
I have this issue to when attempting to copy 2+ of the same model at once. Seems to be that only the last scheduled copy is performed all other copies are cancelled with the error outlined above. |
Are you guys trying to copy the same model instance multiple times or are you copying different instances of the same model type? |
Hi. |
Makes sense. The copy task runner has a drop concurrency task policy. That means it will only execute the first request and ignore the rest until it's done running. I need to investigate other concurrency policies before just removing this one due to unforeseen implications. In the mean time, you guys will need to chain your requests. async copyModels(model) {
await model.copy();
await model.copy();
await model.copy();
} |
I also tried synchronous promises(with reduce), it did not help (and i was sure it will) . |
Hmmmm thats pretty odd. I'll investigate this further in the next week or two. Pretty swamped at the moment. |
@offirgolan Would you be willing to entertain a PR that makes it possible to allow a configurable set of concurrency options? Something like: model.copy({concurrencyPolicy: 'keepLatest'}) //because i can't spell Enqueue I'm not familiar enough with the guts of EC to understand if you can dynamically apply [COPY_TASK_<TYPE>]: task(function*() { return this.get('COPY_TASK').perform(options)).<TYPE>() |
@donaldwasserman I would if there was a decent way of doing this. I'd rather not bomb the model's proto with a bunch of copy tasks for each concurrency policy. ping @machty any thoughts on how I can support something like this? |
I think we shouldn't enforce any kind of concurrency policy ourselves and leave that choice to the user. @offirgolan do you recall the reason to set the copy task concurrency policy to |
Hello.
I am using ember-data-copyable (0.2.1) to copy models, its very cool! And had no problems till today :( when I tried to copy same model in multiple times.
I have Promise.all(promises), in every of that promises I copy one or more models, but those are always the same models for all promises.
For example, I have 3 models (taskAsignments) , and I want copy all 3 of them in for example 6 promises.
What I encounter is, that all 3 models are copied in firstProcessedPromise and will fail in all other (five) promises with message :
TaskCancelation: TaskInstance 'DS_COPY_TASK_RUNNER' was canceled because it belongs to a 'drop' Task that was already running. For more information, see: http://ember-concurrency.com/#/docs/task-cancelation-help
I tried to rewrite Promise.all with reduce, so all 6 promises would be called in synchronized way, but result was same sadly. I also tried deep and not deep .copy with same result.
If possible please advice if have any idea.
The text was updated successfully, but these errors were encountered: