Giter Site home page Giter Site logo

Comments (9)

bgavrilMS avatar bgavrilMS commented on July 22, 2024

CC @jmprieur for this important bug

from microsoft-authentication-extensions-for-dotnet.

jmprieur avatar jmprieur commented on July 22, 2024

@bgavrilMS can we priortize for next release that will get along with MSAL.NET 4.23.0?

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

@yihezkel - is this a common scenario to have 150 threads do this work?

We've done some stress testing in the past and found that the current approach fails at around ~10-20 threads on Mac and Linux. We've tested Windows as well but haven't found an upper bound, although we may have not tested with 150 threads.

Petro had some thoughts on how to improve but I do not know if 150 threads can be achieved.

from microsoft-authentication-extensions-for-dotnet.

yihezkel avatar yihezkel commented on July 22, 2024

Quick note - this was discussed offline

from microsoft-authentication-extensions-for-dotnet.

jmprieur avatar jmprieur commented on July 22, 2024

@yihezkel : I was not part of the offline conversation. what was discussed/decided? is this still an issue?

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

This is still an issue, and we should fix it at some point by using read locks as well as write locks. I marked it as P2 because the use case is not common - around 150 threads running concurrently. But it is not extreme, since an SDK can be used for parallel calls.

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

This token caching library is meant to be used in public client scenarios, such as desktop clients, which should not exibit this level of concurrency. If you require this level of concurrency I suggest you experiment with using a different syncronization mechanism. When this library was designed, we chose to use file locks because they are ubiquitous and we have not found alternatives that would easily work across the 3 OSes. I do not think this requirements has changed.

from microsoft-authentication-extensions-for-dotnet.

yihezkel avatar yihezkel commented on July 22, 2024

I suggest this limitation/assumption be documented. For example, https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/wiki/Cross-platform-Token-Cache only says that one of the goals is "Token cache storage can be accessed by multiple processes concurrently.", which is true but with a qualification.

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

We will not be fixing this as most public client use a single / a few thread to get tokens. Nobody else complained about this.

If Kusto has a complex scenario requiring many threads, I recommend you use MSAL's lower level cache extensibility to build your own cache, for example an in-memory cache that periodically saves data a file.

Or, if you have a solution for fixing the existing one, please contribute. This project is quite simple.

from microsoft-authentication-extensions-for-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.