-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] RequestQueueLimitPerSession .net

, 08 2017 . 09:51 +
! , , .

.net 4.6.1 .net 4.6.2? release notes, . , , Microsoft release notes, .

- , .net.

?


.net. ? . , - . - , , , , .

, .net 4.7, Microsoft , VS 2017 . 4.6.2.

. , , , . .


System.Web.HttpException (0x80004005): The request queue limit of the session is exceeded.

, wat? 600+ . , .

http/2 asmx , . , .

asmx
, webApi2, - asmx , .


. readonly, .

Global.asax:
if (<   >)
{
    Context.SetSessionStateBehavior(SessionStateBehavior.ReadOnly);
}

. . asmx , web.
, .

!


www.google.ru/search?q=The+request+queue+limit+of+the+session+is+exceeded

? requestQueueLimit ( ), . - , - .

, ! , .

. , . .

MS . , , . ( Resharper).

:
System.Web.HttpException (0x80004005): The request queue limit of the session is exceeded.
at System.Web.SessionState.SessionStateModule.QueueRef()
at System.Web.SessionState.SessionStateModule.PollLockedSession()
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)


. , . :

private void QueueRef() {
    if (!IsRequestQueueEnabled || _rqId == null) { 
        return;
    }

    //
    // Check the limit
    int count = 0;
    s_queuedRequestsNumPerSession.TryGetValue(_rqId, out count);

    if (count >= AppSettings.RequestQueueLimitPerSession) {
        throw new HttpException(SR.GetString(SR.Request_Queue_Limit_Per_Session_Exceeded));
    }

    //
    // Add ref
    s_queuedRequestsNumPerSession.AddOrUpdate(_rqId, 1, (key, value) => value + 1);
}

. RequestQueueLimitPerSession - .net 4.7, .net 3.5?

AppSettings.cs. !

internal const int UnlimitedRequestsPerSession = Int32.MaxValue;
internal const int DefaultRequestQueueLimitPerSession = 50;

if (settings == null || !int.TryParse(settings["aspnet:RequestQueueLimitPerSession"], out _requestQueueLimitPerSession) || _requestQueueLimitPerSession < 0)
    _requestQueueLimitPerSession = BinaryCompatibility.Current.TargetsAtLeastFramework463 ? DefaultRequestQueueLimitPerSession : UnlimitedRequestsPerSession;

.net 4.6.3 ( 4.6.2) , 50 , . , , happy end.

, -, , .. .

P.S.: , release notes. , , 4.7. breaking change, - .
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/335138/

:  

: [1] []
 

:
: 

: ( )

:

  URL