[Erp5-report] r45842 luke - /erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 5 10:52:44 CEST 2011
Author: luke
Date: Thu May 5 10:52:43 2011
New Revision: 45842
URL: http://svn.erp5.org?rev=45842&view=rev
Log:
Listen again in case of 'Interrupted system call'.
This allows to support signal handling and reload server after signal is being
handled.
Modified:
erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py
Modified: erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py
URL: http://svn.erp5.org/erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py?rev=45842&r1=45841&r2=45842&view=diff
==============================================================================
--- erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py [utf8] (original)
+++ erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/bin/tidstorage.py [utf8] Thu May 5 10:52:43 2011
@@ -85,6 +85,7 @@ import sets
import time
import urllib
import socket
+import select
import signal
import getopt
import SocketServer
@@ -510,7 +511,14 @@ def server(address, port):
try:
try:
log('Server listening on %s:%s.'% server.server_address)
- server.serve_forever()
+ while 1:
+ try:
+ server.serve_forever()
+ except select.error, v:
+ if v[0] != 4: # EINTR
+ raise
+ else:
+ break
except KeyboardInterrupt:
log('Shuting down (received KeyboardInterrupt).')
finally:
More information about the Erp5-report
mailing list