Skip to content

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

Closed

Description

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.

Activity

  1. jmprieur commented on Nov 11, 2021

    @jmprieur
    Collaborator

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

  2. bgavrilMS commented on Nov 12, 2021

    @bgavrilMS
    MemberAuthor

    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

  3. jennyf19 commented on Nov 12, 2021

    @jennyf19
    Collaborator

    We considered doing this before, but we discussed with henrikm (@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.

  4. bgavrilMS commented on Nov 12, 2021

    @bgavrilMS
    MemberAuthor

    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();
        );
  5. jennyf19 commented on Dec 23, 2021

    @jennyf19
    Collaborator

    closing as duplicate of #1047

  6. jennyf19 commented on Jan 8, 2022

    @jennyf19
    Collaborator
  7. added this to the 1.22.0 milestone on Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions