-
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
Fix remoting logging DefaultAddress race condition #7305
Fix remoting logging DefaultAddress race condition #7305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
@@ -189,7 +189,7 @@ public ActorPath RootPath | |||
public Deployer Deployer { get; protected set; } | |||
|
|||
/// <inheritdoc/> | |||
public Address DefaultAddress { get { return Transport.DefaultAddress; } } | |||
public Address DefaultAddress { get { return Transport?.DefaultAddress; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure we return null instead of throwing an NRE if Transport
is still null.
catch // can fail if the ActorSystem (remoting) is not completely started yet | ||
{ | ||
return a.Path.ToString(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second guard to make sure that, in the event that any exception is thrown, we still return a valid actor path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #7304
akka.net/src/core/Akka/Event/Logging.cs
Line 115 in 3eacb6c
This line can throw an NRE if remoting is not up and running yet
ExtendedActorSystem.Provider.DefaultAddress
=>RemoteActorRefProvider.DefaultAddress
=>Transport.DefaultAddress
<-- Transport property is nullChanges
Make sure that we catch any NRE thrown when
Logging
tries to accessExtendedActorSystem.Provider.DefaultAddress