ipython / ipython/ipykernel

IPythonKernel.log.debug can get stuck (waiting for writable socket ?)

未关闭
#244 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
734
派生
412
平均合并
1 天 5 小时
30 天内合并 PR
8

描述

I have (roughly) the following (working on Jedi completion):

```
def do_complete(self, code, cursor_pos):
...
txt, matches = self.shell.complete('', line, line_cursor)
result = {'matches' : matches,
'cursor_end' : cursor_pos,
'cursor_start' : cursor_pos - len(txt),
'metadata' : {},
'status' : 'ok'}
self.log.debug(json.dumps(result))
return result
```

The self.log.debug line will semi-randomly (like randomly but highly biased toward reproductible) just block. I've narrowed it down to it by printing a non context dependant long string (independant of the result). That's seem to be triggered only by nteract (cc @rgbkrk), but it feel worry some that enabling logging can halt the kernel in an indefinitely waiting state (which took me a days to debug).

I'm going to assume that's because the stream is waiting for something to write what has been written to it so write more and vice-versa on the other side. Unsure if there is a bug and whether this is smth we want to fix.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。