Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Better handling of interrupt syscall

Happens regularly when suspending/resuming, but has no real effect on
the socket.

Signed-off-by: Jack Miller <jack@codezen.org>
  • Loading branch information...
commit 0d566ebc2da8cda236e40357aecd16a834df0f0c 1 parent d1d873c
Jack Miller authored October 18, 2012

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. 14  canto_next/server.py
14  canto_next/server.py
@@ -50,8 +50,8 @@ def queue_loop(self, conn):
50 50
     # Sit and select for connections on sockets:
51 51
 
52 52
     def conn_loop(self, sockets):
53  
-        try:
54  
-            while self.alive:
  53
+        while self.alive:
  54
+            try:
55 55
                 r, w, x = select.select(sockets, [], sockets)
56 56
                 for s in sockets:
57 57
                     # If socket is readable, it's got a pending connection.
@@ -59,11 +59,11 @@ def conn_loop(self, sockets):
59 59
                         conn = s.accept()
60 60
                         log.info("conn %s from sock %s" % (conn, s))
61 61
                         self.queue.put((conn[0], ("NEWCONN","")))
62  
-        except Exception as e:
63  
-            tb = traceback.format_exc()
64  
-            log.error("Connection monitor thread dead on exception:")
65  
-            log.error("\n" + "".join(tb))
66  
-            return
  62
+            except Exception as e:
  63
+                tb = traceback.format_exc()
  64
+                log.error("Connection monitor exception:")
  65
+                log.error("\n" + "".join(tb))
  66
+                log.error("Attempting to continue.")
67 67
 
68 68
     def start_conn_loop(self):
69 69
         self.conn_thread = Thread(target = self.conn_loop,

0 notes on commit 0d566eb

Please sign in to comment.
Something went wrong with that request. Please try again.