[Twisted-Python] Persisted protocol?

Laurens Van Houtven _ at lvh.cc
Wed Apr 6 06:41:08 EDT 2011


On Wed, Apr 6, 2011 at 9:30 AM, Tim Allen <screwtape at froup.com> wrote:

> On Wed, Apr 06, 2011 at 10:16:03AM +0300, anatoly techtonik wrote:
> > From http://twistedmatrix.com/documents/current/core/howto/udp.html
> >
> > """As you can see, the protocol is registered with the reactor. This
> means it
> > may be persisted if it's added to an application..."""
> >
> > What does 'persisted` here mean?
>
> At some point in the past, somebody decided it would be a great idea to
> have Twisted's "twistd" start applications from Python pickles; you
> could start up a server, configure it interactively, and when you shut
> it down the entire server state would be persisted in a pickle-file;
> when you started it up it would resume exactly as it had been when you
> shut it down.
>

Whoa hang on. Without trying to hijack the thread, this is the entire
premise of infobarb, the IRC bot I'm building for #python-*, except
s/pickle/sqlite/, so if this is a horrible idea I'd like to know before I
build it.

>
> The idea seems to have fallen from grace, possibly because restarting
> a process is often the simplest way to resolve a production problem.
> These days, new Twisted users are encouraged to use Python ".tac" files
> rather than ".tap" pickles, and I expect that sentence is just a relic
> of that bygone era.
>

I suppose the problem you're suggesting is that the pickle is in a state
where running the server is impossible: do you mean like the pickle is
corrupted, or pickle has a bunch of settings that just can't work... ?

Would this problem be fixed by implementing features like differential
snapshots? Maybe a replayable or reverse-replayable event log?

cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110406/c01a91de/attachment.htm 


More information about the Twisted-Python mailing list