Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/core/Akka.Remote/Endpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1481,8 +1481,17 @@ private bool WriteSend(EndpointManager.Send send)
send.Recipient, send.Recipient.Path, send.SenderOption ?? _system.DeadLetters);
}

var pdu = _codec.ConstructMessage(send.Recipient.LocalAddressToUse, send.Recipient,
SerializeMessage(send.Message), send.SenderOption, send.Seq, _lastAck);
ByteString pdu;
try
{
pdu = _codec.ConstructMessage(send.Recipient.LocalAddressToUse, send.Recipient,
SerializeMessage(send.Message), send.SenderOption, send.Seq, _lastAck);
}
catch (Exception e) when (e is not SerializationException)
{
// resolves https://github.com/akkadotnet/akka.net/issues/7922
throw new SerializationException("Serializer failed with exception", e);
}

_remoteMetrics.LogPayloadBytes(send.Message, pdu.Length);

Expand Down Expand Up @@ -1518,14 +1527,6 @@ private bool WriteSend(EndpointManager.Send send)
LogPossiblyWrappedMessageType(send.Message));
return true;
}
catch (ArgumentException ex)
{
_log.Error(
ex,
"Serializer threw ArgumentException for message type [{0}]. Transient association error (association remains live)",
LogPossiblyWrappedMessageType(send.Message));
return true;
}
catch (EndpointException ex)
{
PublishAndThrow(ex, LogLevel.ErrorLevel);
Expand Down
Loading