oslo.service ProcessLauncher fails to call stop()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Invalid
|
Undecided
|
Unassigned | ||
oslo.service |
Fix Released
|
Undecided
|
jun923.gu |
Bug Description
Version:OpenStack pike version
Cinder: 11.0.0-1.el7
oslo-service: 1.25.1-1.el7
oslo-messaging: 5-30.2-1.el7
When I startup openstack-
Next, I print the stack information of cinder-volume process and found that cinder-volume block at the _wait funciton of _OrderedTask class.
After analyzing the log,I found that when startup cinder-volume service, cinder/
1. Add a raise code after self.manager.
2. restart the cinder-volume service.
After analyzing, the cause of the problem is that wait function is called and stop funtion is not called in the oslo_messaing/
Changed in oslo.messaging: | |
status: | New → Invalid |
summary: |
- oslo.messaging _OrderedTask wait condition lock + oslo.service ProcessLauncher fails to call stop() |
Changed in oslo.service: | |
assignee: | nobody → jun923.gu (gujun1989) |
I pay attention to the below code for oslo.service.
def _child_ wait_for_ exit_or_ signal( self, launcher):
status = 0
signo = 0
# NOTE(johannes): All exceptions are caught to ensure this
launcher. wait() handler. signals_ to_name[ exc.signo]
LOG. info('Child caught %s, exiting', signame)
LOG. exception( 'Unhandled exception')
# doesn't fallback into the loop spawning children. It would
# be bad for a child to spawn more children.
try:
except SignalExit as exc:
signame = self.signal_
status = exc.code
signo = exc.signo
except SystemExit as exc:
status = exc.code
except BaseException:
status = 2
return status, signo
def _start_child(self, wrap):
LOG.info( 'Forking too fast, sleeping')
time. sleep(1)
if len(wrap.forktimes) > wrap.workers:
# Limit ourselves to one process a second (over the period of
# number of workers * 1 second). This will allow workers to
# start up quickly but ensure we don't fork off children that
# die instantly too quickly.
if time.time() - wrap.forktimes[0] < wrap.workers:
pid = os.fork()
self. launcher = self._child_ process( wrap.service)
self. _child_ process_ handle_ signal( )
status, signo = self._child_ wait_for_ exit_or_ signal(
self. launcher) and_daemon( signo):
self. launcher. wait()
break
self. launcher. restart( )
if pid == 0:
while True:
if not _is_sighup_
return pid
When the exception occurred, _child_ wait_for_ exit_or_ signal function would catch the exception. The exception is SystemExit. The function just get the code of exception, don't do other operations. I think the function miss the stop function call.