python - 【多进程日志回滚失败】subprocess,子进程拷贝了主进程的文件描述符,导致主进程回滚日志失败
PHP中文网
PHP中文网 2017-04-18 09:20:53
0
1
355
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
阿神

Answer the following by yourself, using a method to close each other's log handler when the main process and sub-process are started:

log = logging.getLogger(config.CTRL_LOGGER_NAME)
for handler in log.handlers:
    handler.flush()
    handler.close()
    log.removeHandler(handler)

This problem may be caused by a bug in subprocess. Subprocess provides the close_fds parameter but it does not take effect

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template