Git Product home page Git Product logo

Comments (4)

JonCole avatar JonCole commented on June 14, 2024

@564064202 I believe you are asking for an API that you can call to release the lock for a given session. Is that correct? Also, can you please explain why you want such an API? What is the scenario?

from aspnet-redis-providers.

introspection3 avatar introspection3 commented on June 14, 2024

@JonCole
A lot of people has this question about why there is locking of session in every request.
We need a no locks option. We found that locking sometimes leads to a cascading event were many servers end up waiting on the same session to unlock.

I just discovered that every request in an ASP.Net web application gets a Session lock at the beginning of a request, and then releases it at the end of the request!

In case the implications of this are lost on you, as it was for me at first, this basically means the following:

Anytime an ASP.Net webpage is taking a long time to load (maybe due to a slow database call or whatever), and the user decides they want to navigate to a different page because they are tired of waiting, THEY CAN'T! The ASP.Net session lock forces the new page request to wait until the original request has finished its painfully slow load. Arrrgh.
Anytime an UpdatePanel is loading slowly, and the user decides to navigate to a different page before the UpdatePanel has finished updating... THEY CAN'T! The ASP.net session lock forces the new page request to wait until the original request has finished its painfully slow load. Double Arrrgh!
So what are the options? So far I have come up with:

Implement a Custom SessionStateDataStore, which ASP.Net supports. I haven't found too many out there to copy, and it seems kind of high risk and easy to mess up.
Keep track of all requests in progress, and if a request comes in from the same user, cancel the original request. Seems kind of extreme, but it would work (I think).
Don't use Session! When I need some kind of state for the user, I could just use Cache instead, and key items on the authenticated username, or some such thing. Again seems kind of extreme.
I really can't believe that the ASP.Net Microsoft team would have left such a huge performance bottleneck in the framework ! Am I missing something obvious? How hard would it be to use a ThreadSafe collection for the Session?

from aspnet-redis-providers.

introspection3 avatar introspection3 commented on June 14, 2024

@JonCole

from aspnet-redis-providers.

JonCole avatar JonCole commented on June 14, 2024

The way the question was phrased, it sounded like this was something else, thus the request for clarification. There is already an issue (#21) tracking support for a lock-free solution. We will continue the discussion on that thread rather than having multiple for the same topic. Note that we have been in discussion with the ASP.NET team and about this topic and we will provide a path forward as soon as possible.

from aspnet-redis-providers.

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.