[Twisted-Python] What to do with the session for a t.w.Site after the previous session has expired

Adi Roiban adi at roiban.ro
Mon Sep 25 03:09:51 MDT 2017


The main ticket is here  https://twistedmatrix.com/trac/ticket/9288

But the main discussion is on the PR.

I am writing this email, as a notification. Please follow up over PR.

----------

The bug is:

When you have a long-running request, (more than the sessionTimeout)
and you want to get the session at the end of the request, you get an
error like `twisted.internet.error.AlreadyCalled: Tried to cancel an
already-called event.`

The possibilities for fixing this (as described by Exarkun):

1. You get back the same Session object as you had before, but with
its lifetime extended as though you've just `touch()`'d it.
2. You get back a new Session object but with the same uid as the one
you had before with a life time of `sessionTimeout` starting at the
point of the `getSession` call.
3. You get back a new Session object with a different uid - basically
a whole new session, as if the previous one never existed.

Check the PR for the reason why you want Option 2 or 3.

Right now, we are on course of implementing Option 1.

If you think that Option 1 is wrong, please leave your feedback over the PR :)

Thanks,
-- 
Adi Roiban



More information about the Twisted-Python mailing list