[ZODB-Dev] [ zodb-Bugs-536416 ] ZEO log rotation traceback

noreply@sourceforge.net noreply@sourceforge.net
Fri, 05 Apr 2002 09:47:56 -0800


Bugs item #536416, was opened at 2002-03-28 20:07
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=536416&group_id=15628

Category: None
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Jeremy Hylton (jhylton)
Summary: ZEO log rotation traceback

Initial Comment:
Sending SIGHUP to a ZEO server is supposed to rotate
the logs.  When AJ tried it, it failed and printed the
following tracebacks.  The process exited before
rotating the logs.

[zope@yetix ZEOStorage]$ error: uncaptured python
exception, closing channel <StorageServer listening
:9001 at 8194e24> (exceptions.TypeError:unpack
non-sequence
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|poll|92]
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|handle_read_event|380]
[/home/zope/opt/Python-2.1.2/lib/python2.1/site-packages/ZEO/StorageServer.py|handle_accept|117])
error: uncaptured python exception, closing channel
<select-trigger (pipe) at 81059cc>
(exceptions.OSError:[Errno 11] Resource temporarily
unavailable
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|poll|92]
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|handle_read_event|386]
[/home/zope/opt/Python-2.1.2/lib/python2.1/site-packages/ZEO/trigger.py|handle_read|95]
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|recv|338]
[/home/zope/opt/Python-2.1.2/lib/python2.1/asyncore.py|recv|520])
Exception exceptions.OSError: (9, 'Bad file
descriptor') in <method trigger.__del__ of trigger
instance at 0x81059cc> ignored



----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-04-05 19:47

Message:
Logged In: YES 
user_id=21627

On what system do you get EWOULDBLOCK if select is
interrupted? The only possible errors for select(2) are
EBADF, EINTR, EINVAL, and ENOMEM.

Perhaps you are talking about read/write, for which EAGAIN
is a possible result?

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-04-05 00:09

Message:
Logged In: YES 
user_id=31392

I needed to fix two different places in ZEO to get this
working.  First, ZEO needs to be prepared for accept() to
return None.  Second, I hacked trigger so that sn os.error
(11 / EAGAIN) is treated just like a socket.error EAGAIN; it
returns from the read with no data.

This is even to get log rotation working if your backend
logger supports it, but zLOG w/ MinimalLogger aka
STUPID_LOG_FILE does not.

Fixed on the zeo-1_0-debug-branch and on zeo-1_0-branch, but
not yet on the trunk.  I'm going to commit the debug branch
to the trunk RSN.


----------------------------------------------------------------------

Comment By: Chris McDonough (chrism)
Date: 2002-03-28 20:23

Message:
Logged In: YES 
user_id=32974

I saw this problem when writing logrotation code for Zope.  
It happens when the select call is interrupted (which 
raises an EWOULDBLOCK socket error).  The select trigger 
uses a pipe, which for some reason gets broken when a 
signal is caught.  I got around it by changing the Wakeup 
(you stupid bastard ;-) code that uses a select_trigger to 
use a new pipe if it detected its original pipe was 
broken.  See 
http://cvs.zope.org/~checkout~/Zope/ZServer/PubCore/ZEvent.p
y?rev=1.7.2.1&content-
type=text/plain&only_with_tag=chrism_logrotate_branch


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=115628&aid=536416&group_id=15628