Strange interaction with matplotlib magic
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 38/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- backend-api-design
Piste de recherche
Reproduire la boucle d’exécution avec jupyter_client et ipykernel en utilisant %matplotlib qt, en comparant le message iopub execution_state: idle avec wait_for_ready après une exception. Suivre le comportement d’abandon du kernel et déterminer quel signal permet de manière fiable la requête d’exécution suivante ; le travail est terminé lorsque l’ordre est compris et que le comportement signalé dispose d’une résolution vérifiée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Python
- Étoiles
- 734
- Forks
- 411
- Merge moyen
- 1 j 11 h
- PR mergées (30 j)
- 12
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ipython/ipykernel
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
ipython/ipykernel#1554 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Interrupt on swallowed `KeyboardInterrupt` exceptions (`SIGINT`) when pressing twice (within 5 seconds)Peut-être à nouveau libre @Carreau l’a pris il y a 33 jours, et aucune pull request n’est ouverte. Ouverte
ipython/ipykernel#1550 · 1 commentaire · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 3/5 1-2 jours Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de ipython/ipykernel
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
bot-found bug priority: P3
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
ls1intum/edutelligence#1098 ·
Les mainteneurs répondent en général sous 1 jour