Comment 2 for bug 1896734

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote : Re: A privsep daemon hangs when debug logging is enabled

Ultimately, things hang when the logger attempts to access log handlers:

(Pdb) where
  /usr/bin/privsep-helper(10)<module>()
-> sys.exit(helper_main())
  /usr/lib/python3/dist-packages/oslo_privsep/daemon.py(558)helper_main()
-> Daemon(channel, context).run()
  /usr/lib/python3/dist-packages/oslo_privsep/daemon.py(370)run()
-> self.loop()
  /usr/lib/python3/dist-packages/oslo_privsep/daemon.py(512)loop()
-> future.add_done_callback(self._create_done_callback(msgid))
  /usr/lib/python3.6/concurrent/futures/_base.py(403)add_done_callback()
-> fn(self)
  /usr/lib/python3/dist-packages/oslo_privsep/daemon.py(476)_call_back()
-> {'msgid': msgid, 'reply': reply})
  /usr/lib/python3.6/logging/__init__.py(1630)debug()
-> self.log(DEBUG, msg, *args, **kwargs)
  /usr/lib/python3.6/logging/__init__.py(1674)log()
-> self.logger.log(level, msg, *args, **kwargs)
  /usr/lib/python3.6/logging/__init__.py(1374)log()
-> self._log(level, msg, args, **kwargs)
  /usr/lib/python3.6/logging/__init__.py(1444)_log()
-> self.handle(record)
  /usr/lib/python3.6/logging/__init__.py(1454)handle()
-> self.callHandlers(record)
> /usr/lib/python3.6/logging/__init__.py(1513)callHandlers()
-> for hdlr in c.handlers:

> /usr/lib/python3.6/logging/__init__.py(1454)handle()
-> self.callHandlers(record)
(Pdb) s
--Call--
> /usr/lib/python3.6/logging/__init__.py(1500)callHandlers()
-> def callHandlers(self, record):
(Pdb) n
> /usr/lib/python3.6/logging/__init__.py(1510)callHandlers()
-> c = self
(Pdb) l
1505 logger hierarchy. If no handler was found, output a one-off error
1506 message to sys.stderr. Stop searching up the hierarchy whenever a
1507 logger with the "propagate" attribute set to zero is found - that
1508 will be the last logger whose handlers are called.
1509 """
1510 -> c = self
1511 found = 0
1512 while c:
1513 for hdlr in c.handlers:
1514 found = found + 1
1515 if record.levelno >= hdlr.level:
(Pdb) n
> /usr/lib/python3.6/logging/__init__.py(1511)callHandlers()
-> found = 0
(Pdb) n
> /usr/lib/python3.6/logging/__init__.py(1512)callHandlers()
-> while c:
(Pdb) n
> /usr/lib/python3.6/logging/__init__.py(1513)callHandlers()
-> for hdlr in c.handlers:
(Pdb) c.handlers
<HANGS HERE>