BTW, I am using the GIT version, I reviewed back to the released version 0.31, and it's fine, I currently change to the stable version 0.31 instead of GIT version.
2009/1/5 Alva Yi <[email protected]> > it's provied to be a BUG here. I think I fixed this problem. > this bug cann't be fixed by remove the return exporess simply, and the > clean work cann't be done in the unload processor > or the wsgifunc can't get header and status from web.ctx. I moved the clean > work before the return express of wsgifunc in application.py, it seems to be > work fine for me now, any other good idea for the BUGFIX? please tell use an > 'official way' > > . > 2009/1/5 Alva Yi <[email protected]> > >> here is the code a picked from application.py >> may be it's a bug here, it is the return expression that stoped the clean >> work! >> >> >> def _cleanup_threadlocal(self): >> return <-------------------LOOKES LIKE A BUG >> #@@@ >> # Since the CherryPy Webserver uses thread pool, the thread-local >> state is never cleared. >> # This interferes with the other requests. >> # clearing the thread-local storage to avoid that. >> # see utils.ThreadedDict for details >> import threading >> t = threading.currentThread() >> if hasattr(t, '_d'): >> del t._d >> >> 2009/1/5 Alva Yi <[email protected]> >> >> Thanks for your reply. I just have read CherryPy Server's source code, and >>> I even want to add a row to clear the dictionary after the request even it >>> is not a good idea to hack it like this. >>> And as you remained, how can I use session? bound it to web.ctx? I just >>> didn't figure it out. >>> It's seems that all the code examples of session usage have problem like >>> I said, after a few requests, the threads become 'dirty'. >>> can you give me another example? thank you. >>> >>> 2009/1/5 Aaron Swartz <[email protected]> >>> >>> >>>> Yes, ThreadedDict doesn't clear its dictionaries when a request is >>>> done, because it doesn't know anything about requests. web.ctx, on the >>>> other hand, does get cleared at the end of requests. >>>> >>>> >>>> >>>> >>> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
