Strange interaction with matplotlib magic
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- backend-api-design
Rechercherichtung
Reproduziere die Ausführungsschleife mit jupyter_client und ipykernel unter Verwendung von %matplotlib qt, und vergleiche die iopub-Nachricht execution_state: idle mit wait_for_ready nach einer Exception. Verfolge das Abbruchverhalten des Kernels und ermittle, welches Signal zuverlässig die nächste Ausführungsanforderung zulässt; abgeschlossen ist die Aufgabe, wenn die Reihenfolge verstanden ist und das gemeldete Verhalten eine verifizierte Lösung hat.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I have an app that uses jupyter_client to interact with an ipykernel. In that app I have an execution loop that sends an execute request and then waits for a reply on the iopub channel that has "execution_state": "idle". I assume that when this message is received it is done executing and ready to execute something else. I never send a second execute request until I get the idle-state reply.
This works until I use the %matplotlib magic to load a gui backend (e.g., %matplotlib qt). After that, things begin to behave strangely. If I send code to execute, and that code raises an exception, I get the error reply normally. But then whatever code I send next is aborted without ever being executed. I can only assume this is due to some interaction with the gui event loop that that matplotlib magic is creating, but I can't figure out exactly where the problem lies. It seems that the "stop aborting" event somehow is not processed until after the next execution request I send (even if the app just sits idle in between the exception-raising code and my next execution request). In other words things seem to happen out of order: I send a request, it raises an exception, the kernel "aborts the queue" (even though there are no other requests in the queue), I then send a new request, and the kernel then aborts that (even though it wasn't in the queue when the kernel decided to abort).
I'm not sure if this is a problem with ipykernel or with jupyter_client, but I'm posting here to see if there's something else I should be doing on the jupyter_client end. In particular, I want to know what message I need to wait for after submitting an execution request that tells me "the kernel is done processing, the next execution request you send will be processed and will not be aborted because of some lingering earlier error". I thought that was the idle-state message, but apparently not, because when I receive that message it seems the kernel might still be in a state where it is going to abort whatever I send it (because it thinks they were all part of one execution queue). Right now I fixed it by inserting a wait_for_ready call after each execution, but I'm not sure if that is overkill or could have any other unexpected effects.
Originally opened as jupyter/jupyter_client#904 by @BrenBarn, migration requested by @blink1073
- Vorherrschende Sprache
- Python
- Sterne
- 734
- Forks
- 412
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 13
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ipython/ipykernel
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
ipython/ipykernel#1569 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
ipython/ipykernel#1554 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Interrupt on swallowed `KeyboardInterrupt` exceptions (`SIGINT`) when pressing twice (within 5 seconds)Evtl. wieder frei @Carreau hat das vor 37 Tagen übernommen, und es ist kein Pull Request offen. Offen
ipython/ipykernel#1550 · 1 Kommentar · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ipython/ipykernel
Ähnliche Issues
-
good first issue hacktoberfest
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
RogueAlg0/taken#387 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
tool-calling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
vllm-project/vllm#59838 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
raullenchai/Rapid-MLX#4042 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
transitmatters/mbta-slow-zone-bot#70 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
open-webui/open-webui#31871 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag