ipython / ipython/ipykernel

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

Ouverte
#244 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
734
Forks
412
Merge moyen
1 j 5 h
PR mergées (30 j)
8

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.