While continuing to run our application with the stability patch I submitted earlier, I discovered additional failure modes for some of our hardware switches were causing unexpected exceptions.
This revision better handles these situations. Signed-off-by: Victor J. Orlikowski <[email protected]> diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index b13ba88..869acd5 100644 --- a/ryu/controller/controller.py +++ b/ryu/controller/controller.py @@ -30,7 +30,7 @@ from ryu.lib.hub import StreamServer import traceback import random import ssl -from socket import IPPROTO_TCP, TCP_NODELAY +from socket import IPPROTO_TCP, TCP_NODELAY, timeout as SocketTimeout, error as SocketError import warnings import ryu.base.app_manager @@ -172,12 +172,11 @@ class Datapath(ofproto_protocol.ProtocolDesc): try: ret = self.socket.recv(required_len) - except: - # Hit socket timeout; decide what to do. - if self.close_requested: - pass - else: + except SocketTimeout: + if not self.close_requested: continue + except SocketError: + self.close_requested = True if (len(ret) == 0) or (self.close_requested): self.socket.close() Best, Victor -- Victor J. Orlikowski <> vjo@[cs.]duke.edu ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
