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

Remove confusing parameter from AzureSilo.Start #2109

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

benjaminpetit
Copy link
Member

Yes, it is a breaking change.

But currently if you do something like this:

var config = AzureSilo.DefaultConfiguration();
config.Globals.DeploymentId = "aca7e5e9105745a0b82be8c5a6b07215";
config.AddAzureTableStorageProvider("AzureStore");
orleansAzureSilo = new AzureSilo();
bool ok = orleansAzureSilo.Start(config);

The Start method will partially ignore the DeploymentId that is in the configuration which is confusing.

@@ -174,6 +169,8 @@ public bool Start(ClusterConfiguration config, string deploymentId = null, strin

// Bootstrap this Orleans silo instance

var deploymentId = host.Config.Globals.DeploymentId;
Copy link
Member

@jdom jdom Sep 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can keep the method signature as is, and here do:
deploymentId = deploymentId ?? host.Config.Globals.DeploymentId ?? serviceRuntimeWrapper.DeploymentId;

This way the change will not be breaking, just doing fallbacks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still confusing for the caller, I don't think it is bad to have a breaking change in this case. I think we should allow to pass a config or a deploymentId that will override the value from the config, but not both.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I also find this very confusing, and think it stems from when Orleans was XML config based only. I think that even today there are still deployments with a static XML configuration, but they want to just override the deploymentId in code. Granted, instead of just calling Start, they could go through the process of manually loading the XML config, then updating the deploymentId, and then calling start.
But I'd be wary about making this breaking change, when we are already thinking that several breaking changes to config/startup are coming in our Orleans 2.0 release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, looks like my concern is addressed in the latest rebase

// Program ident
Trace.TraceInformation("Starting {0} v{1}", this.GetType().FullName, RuntimeVersion.Current);

// Check if deployment id was specified
if (deploymentId == null)
deploymentId = serviceRuntimeWrapper.DeploymentId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean that if the user has an XML configuration, he must explicitly use serviceRuntimeWrapper directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't rely on serviceRuntimeWrapper here. If the user has an XML configuration and want to override the deploymentId, he should use Start(string deploymentId = null, string connectionString = null)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but does he have to manually pass in what was previously the default (the hosted service deployment id)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@jdom
Copy link
Member

jdom commented Sep 6, 2016

The most common use case is that you use Azure's Hosted Service DeploymentId. Overriding is a nice to have.
With the current code in commit fa7a810 this is still the case if you use programmatic config (you start with AzureSilo.DefaultConfiguration()).
Nevertheless if you use an external XML config, this default is lost, and it will use the hardcoded deploymentId in the XML. This default should be preserved by the PR, regardless of how you handle fallbacks or mutually exclusive overrides.

@jdom jdom merged commit 40c7f1c into dotnet:master Sep 14, 2016
@benjaminpetit benjaminpetit deleted the duplicate-deploymentId-param branch February 22, 2018 17:59
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 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.

None yet

3 participants