[Zope] Re: zope2.6.4/python2.2 doesn't restart after crash,
with python2.1 it does
Andrew Langmead
alangmead at boston.com
Tue Nov 9 12:21:07 EST 2004
On Nov 9, 2004, at 11:34 AM, Tim Peters wrote:
> I like #3 best <wink>. Volunteers to work on Python 2.2 vanished long
> ago, and chances are good 2.3.5 will be the last release in the 2.3
> line (2.3.5 will come out after 2.4, probably before this year ends).
> I don't know whether anyone did #1, but if not, there isn't much time
> remaining to do so before 2.3.5.
The realinesigs7.patch in
<https://sourceforge.net/tracker/?
func=detail&aid=960406&group_id=5470&atid=305470> is pretty close to
what Michael Hudson committed to 2.4, and applies pretty cleanly to
2.3.4. Someone well connected to the python development community
<wink> might want to lobby for that change to be backported to the 2.3
branch. If someone wants a patch made that consists precisely of the
changes mwh put into 2.4, I might be able to work that up.
> Wasn't this specific problem also unique to LinuxThreads? That is,
> weren't Linux systems with POSIX-conforming NPTL threads immune to it?
At first it seemed that way, or at least I came up with a Linux
specific work around. After I was knee deep in things, I discovered
that the root cause came down to two things. 1) That Modules/readline.c
was working in a non-thread-safe way (setting a signal handler that
would longjmp() back out of the readline library, ignoring the fact
that the thread that handled the signal may not have been the one that
entered readline) and 2) That 2.2 tried to fix the readline problem by
blocking all but the main thread, which would be the only one to use
readline.
What 2.4 chances do do is back out of the 2.2/2.3 behavior of blocking
signals on threads, resuming the 2.1 behavior. (The C signal handler
runs on any thread, sets a flag, and the main thread runs the python
handler at the next available moment.) and then changed
Modules/readline.c to be thread-safe (and then thankfully Michael
Hudson fixed my fix.)
Since all the problems were pthread/signal related, I guess another
possibility would be to use a python with threading other than pthreads
(the GNU pth library. Win32, Mac OSX's mach threads, etc.) but the
suggestion to change deployment platforms seems pretty severe.
More information about the Zope
mailing list