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

[Feature Request] In the L1/L2 cache, the L2 PUT and DELETE operations should be async fire and forget #1526

Closed
bgavrilMS opened this issue Nov 11, 2021 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@bgavrilMS
Copy link
Member

As per discussion with SharePoint cache owners, they have gotten a perf boost by executing L2 operations in 'fire and forget" mode. Particularly for Redis, PUT operations take a long time. The L1 cache will have been updated anyway.

Should only be done if L1 is enabled.

@bgavrilMS bgavrilMS added the enhancement New feature or request label Nov 11, 2021
@jmprieur
Copy link
Collaborator

How is this achieved, @bgavrilMS ?
By removing the await and adding a pragma disable?

@bgavrilMS
Copy link
Member Author

No, you'd do

Task.Run(async () => ...)

Have a look at this helper function that MSAL uses to perform refresh_in operation in the background: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/master/src/client/Microsoft.Identity.Client/Internal/Requests/SilentRequestHelper.cs#L70

@jennyf19
Copy link
Collaborator

We considered doing this before, but we discussed with @henrik-me and went with a re-try on failure. We'd have to see if they have set the re-try callback and then do fire and forget.

@bgavrilMS
Copy link
Member Author

bgavrilMS commented Nov 12, 2021

I was thinking about that as well. Maybe the re-try can be part of the fire and forget logic

Task.Run(async() => 
    bool success = await WriteToRedis();
    if (!success) 
       await WriteToRedis();
    );

@jennyf19
Copy link
Collaborator

closing as duplicate of #1047

@jennyf19
Copy link
Collaborator

jennyf19 commented Jan 8, 2022

@jennyf19 jennyf19 added this to the 1.22.0 milestone Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants