Author: tack
Date: Sun Jan 14 20:37:16 2007
New Revision: 2395

Modified:
   trunk/base/src/notifier/thread.py

Log:
Log an error when thread pipe has no data.


Modified: trunk/base/src/notifier/thread.py
==============================================================================
--- trunk/base/src/notifier/thread.py   (original)
+++ trunk/base/src/notifier/thread.py   Sun Jan 14 20:37:16 2007
@@ -56,6 +56,7 @@
 import logging
 import fcntl
 import socket
+import errno
 
 # notifier imports
 import nf_wrapper as notifier
@@ -192,8 +193,8 @@
     log.info('create thread notifier pipe')
     _thread_notifier_pipe = os.pipe()
 
-    fcntl.fcntl(_thread_notifier_pipe[0] , fcntl.F_SETFL, os.O_NONBLOCK )
-    fcntl.fcntl(_thread_notifier_pipe[1] , fcntl.F_SETFL, os.O_NONBLOCK )
+    fcntl.fcntl(_thread_notifier_pipe[0], fcntl.F_SETFL, os.O_NONBLOCK)
+    fcntl.fcntl(_thread_notifier_pipe[1], fcntl.F_SETFL, os.O_NONBLOCK)
 
     notifier.socket_add(_thread_notifier_pipe[0], _thread_notifier_run_queue)
 
@@ -216,6 +217,12 @@
     global _thread_notifier_queue
     try:
         os.read(_thread_notifier_pipe[0], 1000)
+    except socket.error, (err, msg):
+        if err == errno.EAGAIN:
+            # Resource temporarily unavailable -- we are trying to read
+            # data on a socket when none is avilable.  This should not
+            # happen under normal circumstances, so log an error.
+            log.error("Thread notifier pipe woke but no data available.")
     except OSError:
         pass
 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to