• Jeremy Hylton's avatar
    There were two copies trigger! · 714c13db
    Jeremy Hylton authored
    The one in ZEO/trigger.py was the good code, but we want it to live in
    ZEO/zrpc/trigger.py.  This checkin makes that change.
    
    The key checkin of ZEO/trigger.py had this checkin comment:
    Fix trigger close/__del__.
    
    The close() mechanism for an asyncore file_dispatcher is not safe to
    call multiple times.  It's calling os.close() on a file descriptor
    (int).  Guido observed that if you call close() twice, you could be in
    trouble:  1) First close() call closes FD 6.  2) Another bit of code
    opens a new file, getting FD 6.  3) Second close() call closes FD 6.
    Waah!  FD 6 is some other file.
    
    The workaround attempt here is to define a close() method on a trigger
    that only closes the file descriptors the first time.
    
    Also, make sure that both file descriptors are closed.  The previous
    version only closed the read-end of the pipe.
    714c13db
trigger.py 6.74 KB