-
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 GetEntityLocation use wrong actor path #6120
Fix GetEntityLocation use wrong actor path #6120
Conversation
@@ -1046,15 +1047,15 @@ async Task ResolveEntityRef(Address destinationAddress, ActorPath entityPath) | |||
// NOTE: in the event that we're querying a shard's location from a ShardRegionProxy | |||
// the shard may not be technically "homed" inside the proxy, but it does exist. | |||
#pragma warning disable CS4014 | |||
ResolveEntityRef(GetNodeAddress(shardRegionRef), shardRegionRef.Path / shardId / shardId); // needs to run as a detached task | |||
ResolveEntityRef(GetNodeAddress(shardRegionRef), shardRegionRef.Path / shardId / entityId); // needs to run as a detached task |
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.
The actor path should be shardRegionRef.Path / shardId / entityId
not shardRegionRef.Path / shardId / shardId
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.
Yep, my mistake
#pragma warning restore CS4014 | ||
} | ||
|
||
return; | ||
} | ||
|
||
#pragma warning disable CS4014 | ||
ResolveEntityRef(GetNodeAddress(shardActorRef), shardActorRef.Path / shardId); // needs to run as a detached task | ||
ResolveEntityRef(GetNodeAddress(shardActorRef), shardActorRef.Path / entityId); // needs to run as a detached task |
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.
Same here, actor path should be shardActorRef.Path / entityId
, not shardActorRef.Path / shardId
// must support ShardRegion.StartEntity in order for | ||
// GetEntityLocation to work properly | ||
case ShardRegion.StartEntity se: | ||
return se.EntityId; | ||
return (int.Parse(se.EntityId) % 10 + 1).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.
Change the test IMessageExtractor
so that the ShardId
does not equal to EntityId
to catch actor path bugs
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.
doh - that's a good catch
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 - probably need to push a new release
(cherry-picked from 86a0679)
Fixes:
GetEntityLocation
does not work withHashCodeMessageExtractor