ipython / ipython/ipykernel

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

Offen
#244 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.