<< The request that runs this code must have also run a cfapplication tag
and therefore kept the session alive, no? >>

Yes.  Imagine thought that a thread that is expiring sessions has just 
determined that the session has expired and then gets suspended as the system 
context switches to another thread.  When the session-killer thread finally 
awakes it will kill that session, regardless of any updates to session state 
that the thread with the cfapplication may have made while the session-killer 
thread was asleep.  Thus a potential race condition.  

Still not sure if this is what's really happening (only the Jrun dudes know 
what monitors/synchronization methods are in use -- perhaps this scenario is 
protected against), but it's the only explanation I can find for the 
disappearance of a session variable right after isdefined has said it's there.  
We often have over 4000 active sessions under load at once too, so the 
opportunity for freak race conditions to show up is more likely. 


> The request that runs this code must have also run a cfapplication 
> tag
> and therefore kept the session alive, no?
> 
> On 12/10/05, Terry Ford <[EMAIL PROTECTED]> wrote:
> > This is what appears to be happening:
> >
> > The thread with this code switches out precisely after the 
> structkeyexists() evaluates true.  The thread that clears inactive 
> sessions becomes active right after it has previously evaluated this 
> session as expiring, so it deletes the session.  The original thread 
> becomes active again, and now has no session, so the second part of 
> the CFIF "session.acceess eq 1" evaluates as an error.
> >
> > If this is the case then I don't think the race condition could even 
> be prevented by CFLOCKing the CFIF block, as the session-clearing 
> thread would ignore it.  It probably hardly ever comes up because the 
> chance of someone suddenly waking up and executing a template that 
> interweaves in that fashion at the exact millisecond that the session 
> times out is rather small.  Cute, though.
> 
> --
> CFAJAX docs and other useful articles:
> http://jr-holmes.coldfusionjournal.
com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226722
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to