diff --git a/congress/server/congress_server.py b/congress/server/congress_server.py index ec2f1d6ed..f7a85c3ac 100644 --- a/congress/server/congress_server.py +++ b/congress/server/congress_server.py @@ -18,11 +18,20 @@ from __future__ import print_function from __future__ import division from __future__ import absolute_import + +# NOTE(ekcs): monkey_patch ASAP to ensure all imports get patched modules +import eventlet +# NOTE(ekcs): get_hub() before monkey_patch() to workaround issue with +# import cycles in eventlet < 0.22.0; +# Based on the worked-around in eventlet with patch +# https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701 +# For details please check https://bugs.launchpad.net/congress/+bug/1746136 +eventlet.hubs.get_hub() +eventlet.monkey_patch() + import socket import sys -import eventlet -eventlet.monkey_patch() from oslo_config import cfg from oslo_log import log as logging from oslo_service import service diff --git a/releasenotes/notes/eventlet-cycle-103edf0cfbafd947.yaml b/releasenotes/notes/eventlet-cycle-103edf0cfbafd947.yaml new file mode 100644 index 000000000..c6e1edd27 --- /dev/null +++ b/releasenotes/notes/eventlet-cycle-103edf0cfbafd947.yaml @@ -0,0 +1,10 @@ +--- +prelude: > +fixes: + - | + On Ubuntu 16.04.3, an eventlet import cycle issue + can prevent Congress from starting. A workaround + is put in place in Congress to avoid this issue. + For more information, see the workaround released + in eventlet 0.22: + https://github.com/eventlet/eventlet/commit/b756447bab51046dfc6f1e0e299cc997ab343701