-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Description
When debug logging is enabled for Akka Remoting and log-received-messages=on or log-sent-messages=on, an exception thrown by a message's toString() method is not caught.
Problem
The debug logging statements pass objects directly to log.debug(). If the message's toString() method throws an exception (e.g. NullPointerException due to a null field in the message), this exception propagates up.
Reproduction Steps
- Enable debug logging for Akka Remoting
- Set
akka.remote.artery.log-received-messages = onorakka.remote.artery.log-sent-messages = on - Send a message where toString() throws an exception (e.g. a case class with a null field that causes NPE during string conversion)
Code Locations
(There might be more locations)
-
Three places for receiving:
if (LogReceive && debugLogEnabled) -
One Place for sending:
if (debugLogSendEnabled)
Expected Behavior
Exceptions thrown during debug logging should be caught and handled gracefully. A warning could be logged instead indicating that the message could not be logged due to a toString() failure.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels