In http://mail.python.org/pipermail/python-dev/2001-October/017799.html
Guido remarks:
Python doesn't attempt to stop daemon threads at all. Note that the
__stop() call is in a finally clause. This probably gets hit because
some other exception happened (caused by the same problem of globals
being replaced by None).
If I trap the currentThread call at line 223 in threading.py,
I find that I can't call currentThread, can't invoke _DummyThread,
so I just forget about it and proceed along and everything
still "works":
def notify(self, n=1):
try:
me = currentThread()
except TypeError,e:
print e
#print "currentThread(): no current thread for", _get_ident()
print "currentThread(): no current thread, probably can't
call _get_ident()"
print "Can't Give it a dummy thread, what to do?"
#me= _DummyThread()
None of the assert self._is_owned, __waiters=self.__waiters,etc.
stuff that follows throws an exception
Now, the purpose of _DummyThread seems to be to
represent for foreign threads, including daemon threads,
to say "don't wait for me". If AppServer is not
started as a daemon, this doesn't seem to be necessary
(unless it's extended at some point to communicate
with foreign threads). If it is started as a daemon,
it detaches from the keyboard, so you shouldn't get
these keyboard errors.
One possibly pertinent note:
# When the main thread exits, it does not do any of its usual
cleanup
(except that try ... finally clauses are honored), and the standard I/O
files are not flushed.
Also, the keyboard error seems to happen
a lot less with Python 2.2.1 than Python 2.2,
but still up around 1 out of 10 or so.
Stephan Diehl wrote:
>>| Yes. I'm running the AppServer by typing "./AppServer" in the WebKit
>>| directory, and I'm stopping it by pressing Ctrl-C. Even if I see that
>>| traceback, it still exits all Python processes.
>>
>>Yeah, I get that, too, but if I use the init.d script, it won't kill t
>>he
>>processes. Maybe it's a permissions thing. I thought I looked into that,
>>I'll have to poke around some more.
>>
>
>
>
> I'm using a AppWorkDir. With that I couldn't use the PID from the init
> script, but the one from the AppServer script that is located in the
> Application working directory. This might also happen in the general case.
> Please see
> http://webware.colorstudy.net/twiki/bin/view/Webware/MakeAppWorkDir
>
> I've seen even more strange things when shutting down the AppServer:
> I'm using a MySql database connection in a Servlet. When shuting down,
> sometimes I get the following errormessage:
>
>-----------------------------------------------------------------------------------------------------
>
> Shutdown Called Mon May 20 12:47:46 2002
> ThreadedAppServer: Shutting Down
> Shutting down the AppServer
> Application is Shutting Down
> Exception in thread Thread-2:
> Traceback (most recent call last):
> File "/usr/local/lib/python2.2/threading.py", line 408, in __bootstrap
> self.run()
> File "/usr/local/lib/python2.2/threading.py", line 396, in run
> apply(self.__target, self.__args, self.__kwargs)
> File "./WebKit/AppServer.py", line 86, in closeThread
> File "./WebKit/ThreadedAppServer.py", line 318, in shutDown
> File "./WebKit/AppServer.py", line 119, in shutDown
> File "/usr/local/Webware/WebKit/Application.py", line 236, in shutDown
> self._sessions.storeAllSessions()
> File "./WebKit/SessionMemoryStore.py", line 61, in storeAllSessions
> File "./WebKit/SessionFileStore.py", line 77, in __setitem__
> UnpickleableError: Cannot pickle <type 'connection'> objects
>
> ./AppServerStandalone: line 3: 1952 Segmentation fault /usr/bin/env
> python Launch.py ThreadedAppServer $*
>
>
>-----------------------------------------------------------------------------------------------------------------------
>
> Since I'm shutting down anyway, I can live with that, but when trying to
> restart, I get:
>
>
>------------------------------------------------------------------------------------------------------------------------
>
> Traceback (most recent call last):
> File "./WebKit/ThreadedAppServer.py", line 566, in run
> File "./WebKit/ThreadedAppServer.py", line 66, in __init__
> File "./WebKit/AppServer.py", line 59, in __init__
> File "./WebKit/AppServer.py", line 145, in createApplication
> File "/usr/local/Webware/WebKit/Application.py", line 167, in __init__
> self._sessions = klass(self)
> File "./WebKit/SessionMemoryStore.py", line 23, in __init__
> File "./WebKit/SessionFileStore.py", line 55, in __getitem__
> KeyError: 20020516184304-22fe80bb69e684b25d77788c2363dfd6
>
>
>---------------------------------------------------------------------------------------------------------------------------
>
> I have then to clean out the "Session" directory.
> I'm not on the latest CVS version at the moment, so it might be my problem.
> Anyway, I'm using Webware 0.7 (something) on Linux.
>
> If this is a general problem, I'd suggest that the startup process will
> ignore (delete) session files, that cause problems
>
>
> _______________________________________________________________
> Hundreds of nodes, one monster rendering program.
> Now that's a super model! Visit http://clustering.foundries.sf.net/
>
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
--
Bill Eldridge
Radio Free Asia
[EMAIL PROTECTED]
_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss