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 LibraryName at ConfigurationOptions level #2502

Merged
merged 6 commits into from
Jul 7, 2023
Merged

add LibraryName at ConfigurationOptions level #2502

merged 6 commits into from
Jul 7, 2023

Conversation

mgravell
Copy link
Collaborator

@mgravell mgravell commented Jul 7, 2023

context: desire to set library name more granularly than provider - for example output cache provider, distributed cache provider, etc

the plan is also to, where possible, respect the pre-existing lib name - i.e. if the provider says "foostore", we'll use the new GetProvider API, ask for that info, and specifiy "foostore ocache", "foostore dcache", etc

@mgravell mgravell requested a review from NickCraver July 7, 2023 11:02
@NickCraver
Copy link
Collaborator

Question here: how important is the connection string version? IMO we can always add it later, and I'd like to avoid the commas problem, which I can easily see someone hitting here - thoughts?

@mgravell
Copy link
Collaborator Author

mgravell commented Jul 7, 2023

@NickCraver I'd be fine with dropping it and making it a code-only feature

@NickCraver
Copy link
Collaborator

If cool with that, IMO better play and maybe it never comes up...don't want to have to deal with parsing if we can just play coy :)

@@ -49,10 +49,12 @@ public static void AddProvider(DefaultOptionsProvider provider)
/// </summary>
public virtual bool IsMatch(EndPoint endpoint) => false;

private static readonly DefaultOptionsProvider s_DefaultProvider = new DefaultOptionsProvider();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a little uncomfortable here because there's a chance this becomes mutable at some point down the road (and we're not returning a new one each time). Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@NickCraver the AddProvider API already kinda assumes that it isn't, since that is instance based; so if it comes up as a mutability issue: we already have a bigger problem

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@NickCraver for example, today you could just do DefaultOptionsProvider.AddProvider(new DefaultOptionsProvider()); - and that needs to work

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree that'd happen if you did that due to matching, but today every caller would be getting their own instance, no? I'm not sure how shifting this changes the example, but does return the same instance for all.

I'm saying this because clientName is stateful, and has the potential to change on subsequent caller/connections as the environment does (e.g. restarting your Azure app after an environment change isn't uncommon).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then any subclass already has this problem?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, yeah it could indeed, good point - this just makes it worse for the default Azure case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm happy to revert the default instance for now and take that point separately; this isn't a hill for today

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we can please - I know this will break some scenarios (silently reporting old IDs, few would notice)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mgravell
Copy link
Collaborator Author

mgravell commented Jul 7, 2023

pushed changes to revert libname config string support, and move to "shipped"

docs/ReleaseNotes.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@NickCraver NickCraver left a comment

Choose a reason for hiding this comment

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

One release notes tweak to match delta, looking good 👍

@mgravell mgravell merged commit ce9506b into main Jul 7, 2023
@mgravell mgravell deleted the libname branch July 7, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants