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

Add Silo RoleName based placement to 3.5.0 #7157

Merged

Conversation

Mazurkevichkv
Copy link
Contributor

No description provided.


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.");
Copy link
Member

@ReubenBond ReubenBond Jul 14, 2021

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

Copy link
Contributor Author

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.

Copy link
Member

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>())

@ReubenBond ReubenBond merged commit 42b0304 into dotnet:3.5.0 Aug 5, 2021
ReubenBond pushed a commit that referenced this pull request Sep 22, 2021
Co-authored-by: Kate Mazurkevych <kamazurk@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants