Merge "ovs-agent: Close ryu app on all exceptions"

This commit is contained in:
Jenkins 2016-11-29 06:52:45 +00:00 committed by Gerrit Code Review
commit 58dfad0cdc
1 changed files with 6 additions and 5 deletions

View File

@ -42,11 +42,12 @@ def agent_main_wrapper(bridge_classes):
ovs_agent.main(bridge_classes)
except Exception:
LOG.exception(_LE("Agent main thread died of an exception"))
# The following call terminates Ryu's AppManager.run_apps(),
# which is needed for clean shutdown of an agent process.
# The close() call must be called in another thread, otherwise
# it suicides and ends prematurely.
hub.spawn(app_manager.AppManager.get_instance().close)
finally:
# The following call terminates Ryu's AppManager.run_apps(),
# which is needed for clean shutdown of an agent process.
# The close() call must be called in another thread, otherwise
# it suicides and ends prematurely.
hub.spawn(app_manager.AppManager.get_instance().close)
class OVSNeutronAgentRyuApp(app_manager.RyuApp):