Skip to content
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

Conversation

Arkatufus
Copy link
Contributor

Fixes:
GetEntityLocation does not work with HashCodeMessageExtractor

@@ -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
Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Contributor Author

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();
Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

@Aaronontheweb Aaronontheweb left a 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

@Aaronontheweb Aaronontheweb added this to the 1.4.43 milestone Sep 27, 2022
@Aaronontheweb Aaronontheweb merged commit 86a0679 into akkadotnet:v1.4 Sep 27, 2022
Arkatufus added a commit to Arkatufus/akka.net that referenced this pull request Sep 27, 2022
Aaronontheweb pushed a commit that referenced this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants