I have an actor system that randomly fails because of messages being delivered to dead letters. Fail meaning it just does not complete
Message [UploadFileFromDropboxSuccessMessage] from akka://MySystem-Actor-System/user/...../DropboxToBlobSourceSubmissionUploaderActor/DropboxToBlobSourceFileUploaderActor--1 to akka://MySystem-Actor-System/user/.../DropboxToBlobSourceSubmissionUploaderActor was not delivered. [5] dead letters encountered .This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
private void InitialState()
{
Receive<UploadFileFromDropboxMessage>(msg =>
{
var sender = Sender;
var self = Self;
var parent = Parent;
var logger = Logger;
UploadFromDropboxToBlobStorageAsync(msg.File, msg.RelativeSourceRootDirectory, msg.BlobStorageDestinationRootPath).ContinueWith(o =>
{
if (!o.IsFaulted)
{
parent.Tell(new UploadFileFromDropboxSuccessMessage(msg.File.Path, o.Result), self);
}
else
{
parent.Tell(new UploadFileFromDropboxFailureMessage(msg.File.Path), self);
}
}, TaskContinuationOptions.ExecuteSynchronously);
});
}
I also tried
private void InitialState()
{
Receive<UploadFileFromDropboxMessage>(msg =>
{
try
{
var result = UploadFromDropboxToBlobStorageAsync(msg.File, msg.RelativeSourceRootDirectory, msg.BlobStorageDestinationRootPath).Result;
Parent.Tell(new UploadFileFromDropboxSuccessMessage(msg.File.Path, result));
}
catch (Exception ex)
{
Parent.Tell(new UploadFileFromDropboxFailureMessage(msg.File.Path, ex));
}
});
}
This happens randomly and happens on both success and complete. I have checked parent.IsNobody()... and this returns false. In the documentation it says that alocal actor can fail:
- if the mailbox does not accept the message (e.g. full BoundedMailbox)
- if the receiving actor fails while processing the message or is already terminated
I can't imagine a use case where this is true but also don't really know how to check from the context of my current actor (even if its just for logging purposes).
EDIT: Does AKKA have a limitation on the total amount of messages in the entire system?
EDIT: This happens 1 would say 10% of the time.
EDIT: Eventually discovered it was an actor waaay higher in the tree being killed. I am still confused why IsNobody() returned false if its in deed dead.