When using "fat" session (~2MB) and multiple (~20) simultaneous calls
the retrieval sometimes fails and lock the session.
The original code blocks on the calling thread (AutoResetEvent.WaitOne())
and uses another thread with the timer to do the polling.
If the polling succeeds, the TimerCallback AutoResetEvent.Set(),
with no guarantes that it will wake up the thread.
(see Remarks in http://msdn.microsoft.com/en-us/system.threading.eventwaithandle.set%28v=vs.110%29)
In this patch we simply replace all this code with an equivalent
loop + sleep, which give us the same behaviour
(we still block the calling thread with the sleep, but we didn't use another one)
Signed-off-by: Frederic Mestayer <[email protected]>
Signed-off-by: Etienne CHAMPETIER <[email protected]>
SessionStateModule.OnSessionExpired is used as a callback for its
'handler' field (SessionStateStoreProviderBase.SetItemExpireCallback),
and is normaly enabled in Init, as well as disabled in OnReleaseRequestState
if the container is abandoned.
However, since the module may stay around being re-used, it may continue
working *without* this callback being invoked/enabled anymore -causing a number of
nasty, hard to debug side effects, as session data ending up in the void-.
So we enable this callback again in OnAcquireRequestState, which is the
point at where we know we have a brand new, working container.
* ASPState.sql: added - schema for the SQL session state server
database.
2009-10-19 Marek Habersack <[email protected]>
* SessionStateModule.cs: enabled SQL session state provider.
* SessionSQLServerHandler.cs: implemented. Uses System.Data.Common
for provider-agnostic implementation. Until an issue with Npgsql's
2.0 factory missing is resolved it defaults to using
Mono.Data.Sqlite as the provider.
Selecting of the data provider is done by putting DbProviderName
in the connection string specified in the
<system.web/sessionState> configuration section.
svn path=/trunk/mcs/; revision=144412
* SessionStateModule.cs: correctly let the handler know if an item
is new when calling SetAndReleaseItemExclusive. Fixes bug #424797
If handler's GetItem doesn't initialize storeLockId to a non-null
value, initialize it to 0. Fixes bug #424797
svn path=/trunk/mcs/; revision=112997
* SessionStateModule.cs: use Request.FilePath instead of
Request.BaseVirtualDirectory to retrieve the cookie-less session
identifier. Fixes bug #397418
2008-07-29 Marek Habersack <[email protected]>
* UrlUtils.cs: fixed a typo in HasSessionId which made it always
return False. Fixes bug #397418
2008-07-29 Marek Habersack <[email protected]>
* SessionStateModule.cs: use Request.FilePath instead of
Request.BaseVirtualDirectory to retrieve the cookie-less session
identifier. Fixes bug #397418
2008-07-29 Marek Habersack <[email protected]>
* HttpRequest.cs: if the FilePath contains embedded cookie-less
session identifier, remove it before computing the base virtual
directory. Fixes bug #397418
svn path=/trunk/mcs/; revision=109156
* SessionStateModule.cs: set the application modifier path to bare
session id.
2008-06-04 Marek Habersack <[email protected]>
* UrlUtils.cs: added internal method HasSessionId
2008-06-04 Marek Habersack <[email protected]>
* SessionStateModule.cs: set application path modifier string to
the bare session ID.
2008-06-04 Marek Habersack <[email protected]>
* HttpResponse.cs: correctly modify virtual path to include the
session ID in cookieless session mode. Fixes bug #396628.
svn path=/trunk/mcs/; revision=104861
* BaseDataBoundControl.cs, ChangePassword.cs, CustomValidator.cs,
DataControlFieldCollection.cs, DataControlField.cs,
PasswordRecovery.cs, PagerSettings.cs: do not use synthetized
event accessors (to avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* AnonymousIdentificationModule.cs, FormsAuthenticationModule.cs,
DefaultAuthenticationModule.cs, MembershipProvider.cs,
WindowsAuthenticationModule.cs, PassportAuthenticationModule.cs,
RoleManagerModule.cs: do not use synthetized event accessors (to
avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* HttpApplication.cs, HttpCachePolicy.cs, SiteMapProvider.cs,
TraceContext.cs: do not use synthetized event accessors (to avoid
locks).
2008-05-30 Marek Habersack <[email protected]>
* SessionStateModule.cs: do not use synthetized event accessors
(to avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* ProfileModule.cs: do not use synthetized event accessors (to
avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* SessionStateModule.cs: do not use synthetized event accessors
(to avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* DataBindingCollection.cs, ExpressionBindingCollection.cs: do not
use synthetized event accessors (to avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* ClientBuildManager.cs: do not use synthetized event accessors
(to avoid locks).
2008-05-30 Marek Habersack <[email protected]>
* CacheDependency.cs: do not use synthetized event accessors (to
avoid locks).
svn path=/trunk/mcs/; revision=104569
* SessionStateModule.cs: reset the storage data item timeout to
the HttpApplication.Session.Timeout value after the Session_Start
event is fired. Fixes bug #382644
svn path=/trunk/mcs/; revision=101632
* SessionStateModule.cs: use TimeSpan.TotalMinutes wherever a
session timeout is required, so that sessions do not expire
prematurely. Fixes bug #339026. Patch from Adriaan van Kekem
<[email protected]>, thanks!
svn path=/trunk/mcs/; revision=88845
* SessionStateModule.cs: if session is abandoned and the handler
supports expiration, disable the handler's session expiration
callback and call SessionStateUtility.RaiseSessionEnd
directly. Fixes bug #81853.
svn path=/trunk/mcs/; revision=80308
* HttpContext.cs (GetGlobalResourceObject): remove unused variable.
* StaticFileHandler.cs (ProcessRequest): remove unused variable.
* HttpApplication.cs (ProcessError): Remove unused variable.
2007-01-20 Miguel de Icaza <[email protected]>
* ClientBuildManager.cs: Remove unused variable (this could be a
real problem, we never use the appPhysicalTargetDir)
* AssemblyBuilder.cs: Remove unused field.
* AppResourceFilesCollection.cs: Remove unused field.
* TemplateControlCompiler.cs (GetExpressionFromString): Remove
unused variable.
* AppResourcesCompiler.cs: Remove unused variable.
* AppSettingsExpressionBuilder.cs (GetAppSetting): remove unused
parameter.
* PageCompiler.cs: Put InternalCreatePageProperty inside the
NET_2_0 block to eliminate warnings.
2007-01-20 Miguel de Icaza <[email protected]>
* HandlerFactoryConfiguration.cs (LoadType): remove unused
variable.
(ctor): do not assign parent, we do not use it, keep the code for
reference.
2007-01-20 Miguel de Icaza <[email protected]>
* ApplicationManager.cs: Remove unused variable.
(ShutdownAll) remove unused variables.
* ApplicationHost.cs: Protect create_dir lock
2007-01-20 Miguel de Icaza <[email protected]>
* SqlRoleProvider.cs: comment out unused code.
* SqlMembershipProvider.cs: Removed unused variables.
Remove unused variable.
* AnonymousIdentificationModule.cs (ClearAnonymousIdentifier):
remove unused variable. This might be a real bug.
2007-01-20 Miguel de Icaza <[email protected]>
* SessionStateModule.cs: Removed unused variables.
2007-01-20 Miguel de Icaza <[email protected]>
* SessionDictionary.cs: Removed unused variable (dirty).
2007-01-20 Miguel de Icaza <[email protected]>
* XhtmlTextWriter.cs: comment out unused code.
* ThemeProvider.cs: comment out unused code.
* DataSourceView.cs: Comment unused variable.
* ClientScriptManager.cs: Put the expandoAttributes inside the 2.0
code
* Control.cs: Put _templateControl inside the NET_2_0 ifdef
2007-01-20 Miguel de Icaza <[email protected]>
* HtmlHead.cs: comment out unused code, in particular metadata is
commented out because nothing could have triggered its creation.
* HtmlButton.cs: Move declaration of `csm' inside the 1.1 case.
2007-01-20 Miguel de Icaza <[email protected]>
* DataControlFieldCollection.cs (RemoveAt): remove unused
variable.
* RoleGroupCollection.cs (OnValidate): Flag as protected, as it
should not show up.
* RadioButton.cs (RaisePostDataChangedEvent): This method was not
used in 1.0, so put the whole method in 2.0
2007-01-20 Miguel de Icaza <[email protected]>
* WebPart.cs: Remove
* PersonalizableAttribute.cs: Remove extra API that was wrong as well.
2006-11-28 Miguel de Icaza <[email protected]>
* WebPart.cs:
2007-01-20 Miguel de Icaza <[email protected]>
* FileUtils.cs (CreateTemporaryFile): Remove unused variable.
svn path=/trunk/mcs/; revision=71399
* SessionStateStoreData.cs: fix constructor signature.
* SessionInProcHandler.cs, SessionStateServerHandler.cs: ensure has a default
constructor to make instantiating same as for custom provider.
* SessionStateModule.cs: support custom providers.
svn path=/trunk/mcs/; revision=70128