diff options
author | Victor Orlikowski <vjo@duke.edu> | 2015-12-25 05:42:01 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-30 14:18:39 +0900 |
commit | 46f4ced1651ef7330fb67e3f76a36b6c73c0261e (patch) | |
tree | 91caf6b58022403f5759f77537ff428c23dfb7cf | |
parent | c085c0d40ebdb6f568f61cd08a044981890b0151 (diff) |
Clean up for stability patch submitted previously
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 <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/controller/controller.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index b13ba889..25b8776d 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() |