6

我最近将我的脚本从 2.x 移植到了 3.x。在通过自动化 (rundeck) 运行的生产过程中,我们看到由于记录器未处理阻塞 I/O 导致的错误。任何如何解决的想法都会很棒。

  • Ubuntu 18.04.1 LTS
  • Python 3.6.7
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 998, in emit
    self.flush()
  File "/usr/lib/python3.6/logging/__init__.py", line 978, in flush
    self.stream.flush()
BlockingIOError: [Errno 11] write could not complete without blocking
4

2 回答 2

4

我在 CI 构建中遇到了同样的错误。看起来这是输出流的容量问题。减少日志输出后,错误消失了。

于 2019-03-06T17:41:15.850 回答
1

我最近在Docker使用 CI 构建图像时遇到了错误docker-compose,我发现一种解决方法可能会对某人有所帮助:

错误:

BlockingIOError: [Errno 11] write could not complete without blocking

如果您不想丢失任何日志,可以将所有日志发送到文件并将其保存为工件,Bamboo并在以下位置进行测试Jenkins

docker-compose build --no-cache my_image > myfile.txt

如果您不想要日志:

docker-compose build --no-cache my_image > /dev/null
于 2020-09-02T08:40:42.880 回答