diff --git a/oslo_service/service.py b/oslo_service/service.py index fa9c37c2..107a5ddb 100644 --- a/oslo_service/service.py +++ b/oslo_service/service.py @@ -34,6 +34,7 @@ import time import eventlet from eventlet import event +from eventlet import tpool from oslo_concurrency import lockutils from oslo_service._i18n import _ @@ -560,6 +561,9 @@ class ProcessLauncher(object): pid = os.fork() if pid == 0: + # When parent used native threads the library on child needs to be + # "reset", otherwise native threads won't work on the child. + tpool.killall() self.launcher = self._child_process(wrap.service) while True: self._child_process_handle_signal() diff --git a/releasenotes/notes/native-threads-on-child-7150690c7caa1013.yaml b/releasenotes/notes/native-threads-on-child-7150690c7caa1013.yaml new file mode 100644 index 00000000..a6525639 --- /dev/null +++ b/releasenotes/notes/native-threads-on-child-7150690c7caa1013.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + `Bug #1983949 + `_: Fixed eventlet + native threads tpool on child process when parent process has used them + before launching the service. +