-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ActorTaskScheduler QueueTask for LongRunning #1410 #1470
Conversation
1f1dda6
to
6032af4
Compare
@JeffCyr mind taking a look at this issue while you're at it? |
@Aaronontheweb Sure, I think the TaskCreationOptions got mixed up here. TaskCreationOptions.LongRunning is a hint that means:
The changes proposed by @Zetanova breaks the ActorTaskScheduler contract (which is to execute tasks in the actor context) by executing the Concerning the AttachedToParent option in @Zetanova's commit, I think the flag is mixed up as well. I tried to explain this one in issue #1346. This flag is poorly documented and this is probably due to the fact that it is generally harmful or useless. The proposed change would allow concurrent execution of tasks in the actor context when this flag is specified, so it is bad. I implemented the LongRunning flag in the refactoring of ActorTaskScheduler included in PR #1484, can you validate that it address your issue appropriately? |
Completely agree with @JeffCyr, this PR breaks actor concurrency constraint due to |
I just realized that my implementation of the LongRunning task is useless in PR #1484. I'm starting a thread just to send a msg in the actor mailbox, the task will still be executed on the actor's IScheduler. I think there is no fix to this issue, the ActorTaskScheduler cannot satisfy the LongRunning hint by design. Do you think we should throw an exception and refuse to execute LongRunning tasks on an ActorTaskScheduler? I'm not sure what is the best trade-off here, it could work to just ignore the flag too. My opinion is that it should behave like a UI thread which ignore the LongRunning flag, the UI would potentially freeze if the task is infinite and the programmer would realize that he must not execute long running tasks in message pump. |
I think ignoring the flag would be the most correct thing to do, as that is inline with how other schedulers work as you describe. The fact that actors shouldn't do long running tasks is something that developers/users of Akka.NET need to learn anyway, as the same apply to the synchronous message pipeline. |
Closing as this breaks actor concurrency.. |
For @Zetanova