-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add Silo RoleName based placement to 3.5.0 #7157
Add Silo RoleName based placement to 3.5.0 #7157
Conversation
|
||
if (siloAddressesSameRole == null || siloAddressesSameRole.Count == 0) | ||
{ | ||
throw new OrleansException($"Available: {membershipTableManager.MembershipTableSnapshot.Entries.FirstOrDefault().Value?.RoleName}. Cannot place grain with RoleName {siloRole}. Either Role name is invalid or there are no active silos with type {siloRole} in MembershipTableSnapshot registered yet."); |
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.
This error message seems like it's intended for debugging the placement director itself - should the first sentence be there? Additionally, if FirstOrDefault()
can return null, the safe navigation operator (?.
) should be used instead of .
immediately after it
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.
Yes, I was planning to remove it. Any suggestion on the proper way of figuring out available RoleNames in test env?
Initially "testhost" was used and it worked locally and for main. Trying to use
var roleName = Assembly.GetEntryAssembly()?.GetName().Name;
but it doesn't seem to be working based on the latest run.
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.
I'm not sure of an automated way - the entry assembly is probably "testhost" or something, but you can pass a configuration variable from your test to the silos by adding it to the TestClusterOptions dictionary (with per-silo overrides) and propagating it to the silo options in a silo configurator (.AddSiloConfigurator<T>()
)
Co-authored-by: Kate Mazurkevych <kamazurk@microsoft.com>
No description provided.