Session Variables disappear
Zope 2.6.2b3, Py 2.1.3, Linux We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables. I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior. Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables. -d
--On Donnerstag, 20. Mai 2004 10:44 Uhr -0700 Dennis Allison <allison@sumeru.stanford.EDU> wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
^^^^^^^^^^^^^^ Extremely old...upgrade at least to the latest 2.6.X version or even better 2.7
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
What do you mean by "go away". Session have a limited lifetime (20 minutes by default). -aj
Session variables have a settable lifetime. I use 2000 minutes as the default and then clear them out when my users close the session (if they remember to do so). The problem has to do with *reading* session variable values usually through a Python Script which does very little but return container.REQUEST['SESSION'][session_var_name] where the session_var_name is passed in. This is a very very common operation that usually works flawlessly. But once in a while it fails with a KeyError Traceback (innermost last): File /lulu/zope/software_home/lib/python/ZPublisher/Publish.py, line 98, in publish File /lulu/zope/software_home/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: home_html) File /lulu/zope/software_home/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: home_html) File /lulu/zope/software_home/lib/python/OFS/DTMLMethod.py, line 126, in __call__ (Object: home_html) File /lulu/zope/software_home/lib/python/DocumentTemplate/DT_String.py, line 474, in __call__ (Object: home_html) File /home/zopesys/lib/python/DocumentTemplate/DT_Let.py, line 75, in render (Object: topic_ident="queries.query_topic_ident(top_id=topic).tuples()[0][0]" course_name="getSessionVariable('currentCourse')" viewpath="scripts.makeHTMLfilename(course_name,topic_ident,component,sequence)") File /lulu/zope/software_home/lib/python/DocumentTemplate/DT_Util.py, line 201, in eval (Object: getSessionVariable('currentCourse')) (Info: getSessionVariable) File <string>, line 2, in f File /lulu/zope/software_home/lib/python/Shared/DC/Scripts/Bindings.py, line 252, in __call__ (Object: getSessionVariable) File /lulu/zope/software_home/lib/python/Shared/DC/Scripts/Bindings.py, line 283, in _bindAndExec (Object: getSessionVariable) File /lulu/zope/software_home/lib/python/Products/PythonScripts/PythonScript.py, line 314, in _exec (Object: getSessionVariable) File Script (Python), line 3, in getSessionVariable File /lulu/zope/software_home/lib/python/AccessControl/ZopeGuards.py, line 90, in guarded_getitem File /lulu/zope/software_home/lib/python/Products/Transience/TransientObject.py, line 170, in __getitem__ KeyError: currentCourse I am loath to upgrade at the moment because I do not want to destabalize the sytem. I was under the impression that 2.6.4 was still stabalizing following the many changes due to the security review. Several of the products we use have not been ported to 2.7 as of yet and we don't have the cycles to do the ports ourselves at the moment. On Thu, 20 May 2004, Andreas Jung wrote:
--On Donnerstag, 20. Mai 2004 10:44 Uhr -0700 Dennis Allison <allison@sumeru.stanford.EDU> wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
^^^^^^^^^^^^^^ Extremely old...upgrade at least to the latest 2.6.X version or even better 2.7
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
What do you mean by "go away". Session have a limited lifetime (20 minutes by default).
-aj
Dennis Allison wrote:
Session variables have a settable lifetime. I use 2000 minutes as the default and then clear them out when my users close the session (if they remember to do so).
Sounds like you want to be using "0 minutes" which, IIRC, means sessions don't expire unless explicitly told to do so, which sounds like what you're after...
I am loath to upgrade at the moment because I do not want to destabalize the sytem. I was under the impression that 2.6.4 was still stabalizing following the many changes due to the security review.
I think 2.6.4 is probably where you want to be though... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Dennis Allison wrote at 2004-5-20 12:36 -0700:
... /lulu/zope/software_home/lib/python/Products/Transience/TransientObject.py, line 170, in __getitem__ KeyError: currentCourse
It is highly unlikely that individual session variables are lost. What can happen: the complete session is lost -- because it timed out, because the session cookie was list, because the request arrived at a different Zope process, ... -- Dieter
Yes, the whole session is lost, but the cookie and browser cookies, etc all survive the timeouts do not appear to be a problem the distribution across Zope processes seems to be OK On Fri, 21 May 2004, Dieter Maurer wrote:
Dennis Allison wrote at 2004-5-20 12:36 -0700:
... /lulu/zope/software_home/lib/python/Products/Transience/TransientObject.py, line 170, in __getitem__ KeyError: currentCourse
It is highly unlikely that individual session variables are lost.
What can happen: the complete session is lost -- because it timed out, because the session cookie was list, because the request arrived at a different Zope process, ...
-- Dieter
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless. -- Paul Winkler http://www.slinkp.com
I do suggest running Zope 2.7.1 when it comes out to help solve the sessioning issues you're experiencing. If you are in a hurry or you want to help test, you can run the current Zope 2.7 branch from CVS and provide feedback. - C On Thu, 2004-05-20 at 13:52, Paul Winkler wrote:
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless.
Thanks Chris. I'm a bit worried that moving to 2.7.X may be risky. When last I looked, not all the products we use had been vetted agains 2.7 and Python 2.3. At the current point in time, we cannot afford any downtime. On Thu, 20 May 2004, Chris McDonough wrote:
I do suggest running Zope 2.7.1 when it comes out to help solve the sessioning issues you're experiencing. If you are in a hurry or you want to help test, you can run the current Zope 2.7 branch from CVS and provide feedback.
- C
On Thu, 2004-05-20 at 13:52, Paul Winkler wrote:
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
In that case, you can probably take these files out of the 2.7 CVS branch and try them in 2.6: Products/Transience/Transience.py Products/Transience/TransientObject.py Products/Sessions/SessionDataManager.py tempstorage/TemporaryStorage.py Note that if you do this, and if you *don't* keep your session data in a TemporaryStorage (e.g. within /temp_folder/session_data) and instead have your session data in a persistent storage, it's safest to delete and recreate the "transient object container" object you're using to do so. You will need to do this if you switch back to the older code too. I fear there may be some (shallow) dependencies on Python 2.2+ in these versions of the modules, so if you're running Python 2.1, you may need to fix them. I can help with this as necessary if you try it first. There are also pending fixes to: ZPublisher/Publish.py Zope/App/startup.py ... that have not been checked in anywhere, but effect session access during an error message... I'd suggest for now you just don't try to do that. - C On Thu, 2004-05-20 at 15:45, Dennis Allison wrote:
Thanks Chris. I'm a bit worried that moving to 2.7.X may be risky. When last I looked, not all the products we use had been vetted agains 2.7 and Python 2.3. At the current point in time, we cannot afford any downtime.
On Thu, 20 May 2004, Chris McDonough wrote:
I do suggest running Zope 2.7.1 when it comes out to help solve the sessioning issues you're experiencing. If you are in a hurry or you want to help test, you can run the current Zope 2.7 branch from CVS and provide feedback.
- C
On Thu, 2004-05-20 at 13:52, Paul Winkler wrote:
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hmmmm... maybe the right thing is to bite the bullet and do the upgrade. On Thu, 20 May 2004, Chris McDonough wrote:
In that case, you can probably take these files out of the 2.7 CVS branch and try them in 2.6:
Products/Transience/Transience.py Products/Transience/TransientObject.py Products/Sessions/SessionDataManager.py tempstorage/TemporaryStorage.py
Note that if you do this, and if you *don't* keep your session data in a TemporaryStorage (e.g. within /temp_folder/session_data) and instead have your session data in a persistent storage, it's safest to delete and recreate the "transient object container" object you're using to do so. You will need to do this if you switch back to the older code too.
I fear there may be some (shallow) dependencies on Python 2.2+ in these versions of the modules, so if you're running Python 2.1, you may need to fix them. I can help with this as necessary if you try it first.
There are also pending fixes to:
ZPublisher/Publish.py Zope/App/startup.py
... that have not been checked in anywhere, but effect session access during an error message... I'd suggest for now you just don't try to do that.
- C
On Thu, 2004-05-20 at 15:45, Dennis Allison wrote:
Thanks Chris. I'm a bit worried that moving to 2.7.X may be risky. When last I looked, not all the products we use had been vetted agains 2.7 and Python 2.3. At the current point in time, we cannot afford any downtime.
On Thu, 20 May 2004, Chris McDonough wrote:
I do suggest running Zope 2.7.1 when it comes out to help solve the sessioning issues you're experiencing. If you are in a hurry or you want to help test, you can run the current Zope 2.7 branch from CVS and provide feedback.
- C
On Thu, 2004-05-20 at 13:52, Paul Winkler wrote:
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Well, if you do try these modules and it works out, I would be willing to backport these changes to the 2.6 branch... but it's up to you. On Thu, 2004-05-20 at 16:57, Dennis Allison wrote:
Hmmmm... maybe the right thing is to bite the bullet and do the upgrade.
On Thu, 20 May 2004, Chris McDonough wrote:
In that case, you can probably take these files out of the 2.7 CVS branch and try them in 2.6:
Products/Transience/Transience.py Products/Transience/TransientObject.py Products/Sessions/SessionDataManager.py tempstorage/TemporaryStorage.py
Note that if you do this, and if you *don't* keep your session data in a TemporaryStorage (e.g. within /temp_folder/session_data) and instead have your session data in a persistent storage, it's safest to delete and recreate the "transient object container" object you're using to do so. You will need to do this if you switch back to the older code too.
I fear there may be some (shallow) dependencies on Python 2.2+ in these versions of the modules, so if you're running Python 2.1, you may need to fix them. I can help with this as necessary if you try it first.
There are also pending fixes to:
ZPublisher/Publish.py Zope/App/startup.py
... that have not been checked in anywhere, but effect session access during an error message... I'd suggest for now you just don't try to do that.
- C
On Thu, 2004-05-20 at 15:45, Dennis Allison wrote:
Thanks Chris. I'm a bit worried that moving to 2.7.X may be risky. When last I looked, not all the products we use had been vetted agains 2.7 and Python 2.3. At the current point in time, we cannot afford any downtime.
On Thu, 20 May 2004, Chris McDonough wrote:
I do suggest running Zope 2.7.1 when it comes out to help solve the sessioning issues you're experiencing. If you are in a hurry or you want to help test, you can run the current Zope 2.7 branch from CVS and provide feedback.
- C
On Thu, 2004-05-20 at 13:52, Paul Winkler wrote:
On Thu, May 20, 2004 at 10:44:32AM -0700, Dennis Allison wrote:
Zope 2.6.2b3, Py 2.1.3, Linux
We use session variables everywhere and have a fairly large number of concurrent sessions. Every so often the session variables go away and the whole house of cards collapses becasuse nearly everything depends upon session variables.
I tried a while back to isolate the problem without success. At that time someone suggestedit was a known problem open problem. I've just checked the collector and did not see any open issues there. The frustrating thing is that it is the irreproducable Heissenbug behavior.
Can anyone shed additional light on the issue. Is anyone else observing similar behavior? Or is the problem something due to the way we are using session variables.
Check the zope-dev list archives, session & transience issues have been under discussion a lot in the past few weeks. Chris McDonough and others have been digging into it. I'm just a bystander, but it sounds likely that sessions in the 2.7.1 release will be much better, if not yet flawless.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (6)
-
Andreas Jung -
Chris McDonough -
Chris Withers -
Dennis Allison -
Dieter Maurer -
Paul Winkler