-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Bug: DefaultMailbox.PostSystemMessage CancellationTokenDisposed exception #1916
Comments
Hi Sindre, good questions. From the mailbox code, we have this: public void PostSystemMessage(object msg)
{
_systemMessages.Push(msg);
if (msg is Stop)
{
_invoker?.CancellationTokenSource?.Cancel();
} My guess w/o digging any deeper would be that the same actor has already received a stop message. and thus the cts is disposed. Why is this not cancelled inside the actor context? But I need to have a better look at all this. |
Yes that's my guess as well.
I see... That make sense in terms of what the system should do, thanks for the explanation. From just my outsider perspective I think that the I also don't have too much experience using Proto.Actor extensively, but since the CancellationTokenSource is on the |
We experience the same issue. We have 600+ tests, each starting and shutting down a cluster; usually, 1 or 2 tests at random experience this error. I believe this is because of the I will submit a PR. |
…ContextExtras.Dispose(). It should fix the CancellationTokenDisposed exception issue asynkron#1916
Should we consider this issue solved now with #1920 ? |
I see that sometimes when running tests (for instance here https://github.com/asynkron/protoactor-dotnet/actions/runs/4042463067/jobs/6950198101#step:6:111 )
that the
DefaultMailbox.PostSystemMessage
can throw an exception when the_invoker.CancellationTokenSource
is disposed.This leads ne to the questions:
CancellationTokenSource
even exposes as an API? (I don't know if there are any reason to why, if so then it would be nice to know 😄 )IMessageInvoker
itself take the responsibility of cancelling its CancellationTokenSource as part of the Disposing it will eventually do whenever theActorContext
FinalizeStopAsync
is inevitably called?And please excuse my ignorance. I'm fairly new to this project and especially the code base 😆
The text was updated successfully, but these errors were encountered: