jupyter / jupyter_client

Jupyter protocol client APIs
https://jupyter-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
381 stars 281 forks source link

Updating jupyter_client dependency as using jupyter_client 7.x leads to different events #793

Open RRosio opened 2 years ago

RRosio commented 2 years ago

When running session and kernel tests for nbclassic, the execution of the following code in a cell, results in only two of the four expected events

import os
from ipykernel.connect import get_connection_file
with open(get_connection_file(), 'w') as f:
       f.write('garbage')
       os._exit(1)

Two events trigged: kernel_restarting.Kernel, kernel_autorestarting.Kernel Two events not triggered: kernel_killed.Session, kernel_dead.Kernel

Using jupyter_client 6.1.12 solves this for macos, however it does not solve this issue on a linux machine and it instead it seems to disrupt other events. Starting a session on a linux machine with jupyter_client 6.1.12 calling, IPython.notebook.session.start(); results in only two of the three expected events. Both kernel_created.Session and kernel_connected.Kernel are triggered while kernel_ready.Kernel is not.

Enviornment Details
$PATH: /home/rreyes/miniconda3/envs/ci_tests/bin /home/rreyes/.vscode-server/bin/da15b6fd3ef856477bf6f4fb29ba1b7af717770d/bin/remote-cli /home/rreyes/miniconda3/condabin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin sys.path: /home/rreyes/miniconda3/envs/ci_tests/bin /home/rreyes/miniconda3/envs/ci_tests/lib/python310.zip /home/rreyes/miniconda3/envs/ci_tests/lib/python3.10 /home/rreyes/miniconda3/envs/ci_tests/lib/python3.10/lib-dynload /home/rreyes/miniconda3/envs/ci_tests/lib/python3.10/site-packages sys.executable: /home/rreyes/miniconda3/envs/ci_tests/bin/python3.10 sys.version: 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:39:04) [GCC 10.3.0] platform.platform(): Linux-5.4.0-52-generic-x86_64-with-glibc2.31 which -a jupyter: /home/rreyes/miniconda3/envs/ci_tests/bin/jupyter pip list: Package Version -------------------- ----------- anyio 3.6.1 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 asttokens 2.0.5 async-generator 1.10 attrs 21.4.0 backcall 0.2.0 beautifulsoup4 4.11.1 bleach 5.0.0 certifi 2022.5.18.1 cffi 1.15.0 charset-normalizer 2.0.12 coverage 6.4 cryptography 37.0.2 debugpy 1.6.0 decorator 5.1.1 defusedxml 0.7.1 entrypoints 0.4 executing 0.8.3 fastjsonschema 2.15.3 h11 0.13.0 idna 3.3 iniconfig 1.1.1 ipykernel 6.13.0 ipython 8.3.0 ipython-genutils 0.2.0 jedi 0.18.1 Jinja2 3.1.2 jsonschema 4.5.1 jupyter-client 6.1.12 jupyter-core 4.10.0 jupyter-server 1.17.0 jupyterlab-pygments 0.2.2 MarkupSafe 2.1.1 matplotlib-inline 0.1.3 mistune 0.8.4 nbclassic 0.3.7 nbclient 0.6.3 nbconvert 6.5.0 nbformat 5.4.0 nbval 0.9.6 nest-asyncio 1.5.5 notebook-shim 0.1.0 outcome 1.1.0 packaging 21.3 pandocfilters 1.5.0 parso 0.8.3 pexpect 4.8.0 pickleshare 0.7.5 pip 22.1.1 pluggy 1.0.0 prometheus-client 0.14.1 prompt-toolkit 3.0.29 psutil 5.9.1 ptyprocess 0.7.0 pure-eval 0.2.2 py 1.11.0 pycparser 2.21 Pygments 2.12.0 pyOpenSSL 22.0.0 pyparsing 3.0.9 pyrsistent 0.18.1 PySocks 1.7.1 pytest 7.1.2 pytest-cov 3.0.0 pytest-tornasync 0.6.0.post2 python-dateutil 2.8.2 pyzmq 23.0.0 requests 2.27.1 requests-unixsocket 0.3.0 selenium 4.1.5 Send2Trash 1.8.0 setuptools 62.3.2 six 1.16.0 sniffio 1.2.0 sortedcontainers 2.4.0 soupsieve 2.3.2.post1 stack-data 0.2.0 terminado 0.15.0 testpath 0.6.0 tinycss2 1.1.1 tomli 2.0.1 tornado 6.1 traitlets 5.2.1.post0 trio 0.20.0 trio-websocket 0.9.2 urllib3 1.26.9 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 1.3.2 wheel 0.37.1 wsproto 1.1.0 conda list: # packages in environment at /home/rreyes/miniconda3/envs/ci_tests: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge anyio 3.6.1 pypi_0 pypi argon2-cffi 21.3.0 pypi_0 pypi argon2-cffi-bindings 21.2.0 pypi_0 pypi asttokens 2.0.5 pypi_0 pypi async-generator 1.10 pypi_0 pypi attrs 21.4.0 pypi_0 pypi backcall 0.2.0 pypi_0 pypi beautifulsoup4 4.11.1 pypi_0 pypi bleach 5.0.0 pypi_0 pypi bzip2 1.0.8 h7f98852_4 conda-forge ca-certificates 2022.5.18.1 ha878542_0 conda-forge certifi 2022.5.18.1 pypi_0 pypi cffi 1.15.0 pypi_0 pypi charset-normalizer 2.0.12 pypi_0 pypi coverage 6.4 pypi_0 pypi cryptography 37.0.2 pypi_0 pypi debugpy 1.6.0 pypi_0 pypi decorator 5.1.1 pypi_0 pypi defusedxml 0.7.1 pypi_0 pypi entrypoints 0.4 pypi_0 pypi executing 0.8.3 pypi_0 pypi fastjsonschema 2.15.3 pypi_0 pypi h11 0.13.0 pypi_0 pypi icu 70.1 h27087fc_0 conda-forge idna 3.3 pypi_0 pypi iniconfig 1.1.1 pypi_0 pypi ipykernel 6.13.0 pypi_0 pypi ipython 8.3.0 pypi_0 pypi ipython-genutils 0.2.0 pypi_0 pypi jedi 0.18.1 pypi_0 pypi jinja2 3.1.2 pypi_0 pypi jsonschema 4.5.1 pypi_0 pypi jupyter-client 6.1.12 pypi_0 pypi jupyter-core 4.10.0 pypi_0 pypi jupyter-server 1.17.0 pypi_0 pypi jupyterlab-pygments 0.2.2 pypi_0 pypi ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc-ng 12.1.0 h8d9b700_16 conda-forge libgomp 12.1.0 h8d9b700_16 conda-forge libnsl 2.0.0 h7f98852_0 conda-forge libstdcxx-ng 12.1.0 ha89aaad_16 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libuv 1.43.0 h7f98852_0 conda-forge libzlib 1.2.11 h166bdaf_1014 conda-forge markupsafe 2.1.1 pypi_0 pypi matplotlib-inline 0.1.3 pypi_0 pypi mistune 0.8.4 pypi_0 pypi nbclassic 0.3.7 pypi_0 pypi nbclient 0.6.3 pypi_0 pypi nbconvert 6.5.0 pypi_0 pypi nbformat 5.4.0 pypi_0 pypi nbval 0.9.6 pypi_0 pypi ncurses 6.3 h27087fc_1 conda-forge nest-asyncio 1.5.5 pypi_0 pypi nodejs 17.9.0 h8839609_0 conda-forge notebook-shim 0.1.0 pypi_0 pypi openssl 3.0.3 h166bdaf_0 conda-forge outcome 1.1.0 pypi_0 pypi packaging 21.3 pypi_0 pypi pandocfilters 1.5.0 pypi_0 pypi parso 0.8.3 pypi_0 pypi pexpect 4.8.0 pypi_0 pypi pickleshare 0.7.5 pypi_0 pypi pip 22.1.1 pyhd8ed1ab_0 conda-forge pluggy 1.0.0 pypi_0 pypi prometheus-client 0.14.1 pypi_0 pypi prompt-toolkit 3.0.29 pypi_0 pypi psutil 5.9.1 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pure-eval 0.2.2 pypi_0 pypi py 1.11.0 pypi_0 pypi pycparser 2.21 pypi_0 pypi pygments 2.12.0 pypi_0 pypi pyopenssl 22.0.0 pypi_0 pypi pyparsing 3.0.9 pypi_0 pypi pyrsistent 0.18.1 pypi_0 pypi pysocks 1.7.1 pypi_0 pypi pytest 7.1.2 pypi_0 pypi pytest-cov 3.0.0 pypi_0 pypi pytest-tornasync 0.6.0.post2 pypi_0 pypi python 3.10.4 h2660328_0_cpython conda-forge python-dateutil 2.8.2 pypi_0 pypi python_abi 3.10 2_cp310 conda-forge pyzmq 23.0.0 pypi_0 pypi readline 8.1 h46c0cb4_0 conda-forge requests 2.27.1 pypi_0 pypi requests-unixsocket 0.3.0 pypi_0 pypi selenium 4.1.5 pypi_0 pypi send2trash 1.8.0 pypi_0 pypi setuptools 62.3.2 py310hff52083_0 conda-forge six 1.16.0 pypi_0 pypi sniffio 1.2.0 pypi_0 pypi sortedcontainers 2.4.0 pypi_0 pypi soupsieve 2.3.2.post1 pypi_0 pypi sqlite 3.38.5 h4ff8645_0 conda-forge stack-data 0.2.0 pypi_0 pypi terminado 0.15.0 pypi_0 pypi testpath 0.6.0 pypi_0 pypi tinycss2 1.1.1 pypi_0 pypi tk 8.6.12 h27826a3_0 conda-forge tomli 2.0.1 pypi_0 pypi tornado 6.1 pypi_0 pypi traitlets 5.2.1.post0 pypi_0 pypi trio 0.20.0 pypi_0 pypi trio-websocket 0.9.2 pypi_0 pypi tzdata 2022a h191b570_0 conda-forge urllib3 1.26.9 pypi_0 pypi wcwidth 0.2.5 pypi_0 pypi webencodings 0.5.1 pypi_0 pypi websocket-client 1.3.2 pypi_0 pypi wheel 0.37.1 pyhd8ed1ab_0 conda-forge wsproto 1.1.0 pypi_0 pypi xz 5.2.5 h516909a_1 conda-forge zlib 1.2.11 h166bdaf_1014 conda-forge conda env: name: ci_tests channels: - conda-forge - defaults dependencies: - _libgcc_mutex=0.1=conda_forge - _openmp_mutex=4.5=2_gnu - bzip2=1.0.8=h7f98852_4 - ca-certificates=2022.5.18.1=ha878542_0 - icu=70.1=h27087fc_0 - ld_impl_linux-64=2.36.1=hea4e1c9_2 - libffi=3.4.2=h7f98852_5 - libgcc-ng=12.1.0=h8d9b700_16 - libgomp=12.1.0=h8d9b700_16 - libnsl=2.0.0=h7f98852_0 - libstdcxx-ng=12.1.0=ha89aaad_16 - libuuid=2.32.1=h7f98852_1000 - libuv=1.43.0=h7f98852_0 - libzlib=1.2.11=h166bdaf_1014 - ncurses=6.3=h27087fc_1 - nodejs=17.9.0=h8839609_0 - openssl=3.0.3=h166bdaf_0 - pip=22.1.1=pyhd8ed1ab_0 - python=3.10.4=h2660328_0_cpython - python_abi=3.10=2_cp310 - readline=8.1=h46c0cb4_0 - setuptools=62.3.2=py310hff52083_0 - sqlite=3.38.5=h4ff8645_0 - tk=8.6.12=h27826a3_0 - tzdata=2022a=h191b570_0 - wheel=0.37.1=pyhd8ed1ab_0 - xz=5.2.5=h516909a_1 - zlib=1.2.11=h166bdaf_1014 - pip: - anyio==3.6.1 - argon2-cffi==21.3.0 - argon2-cffi-bindings==21.2.0 - asttokens==2.0.5 - async-generator==1.10 - attrs==21.4.0 - backcall==0.2.0 - beautifulsoup4==4.11.1 - bleach==5.0.0 - certifi==2022.5.18.1 - cffi==1.15.0 - charset-normalizer==2.0.12 - coverage==6.4 - cryptography==37.0.2 - debugpy==1.6.0 - decorator==5.1.1 - defusedxml==0.7.1 - entrypoints==0.4 - executing==0.8.3 - fastjsonschema==2.15.3 - h11==0.13.0 - idna==3.3 - iniconfig==1.1.1 - ipykernel==6.13.0 - ipython==8.3.0 - ipython-genutils==0.2.0 - jedi==0.18.1 - jinja2==3.1.2 - jsonschema==4.5.1 - jupyter-client==6.1.12 - jupyter-core==4.10.0 - jupyter-server==1.17.0 - jupyterlab-pygments==0.2.2 - markupsafe==2.1.1 - matplotlib-inline==0.1.3 - mistune==0.8.4 - nbclassic==0.3.7 - nbclient==0.6.3 - nbconvert==6.5.0 - nbformat==5.4.0 - nbval==0.9.6 - nest-asyncio==1.5.5 - notebook-shim==0.1.0 - outcome==1.1.0 - packaging==21.3 - pandocfilters==1.5.0 - parso==0.8.3 - pexpect==4.8.0 - pickleshare==0.7.5 - pluggy==1.0.0 - prometheus-client==0.14.1 - prompt-toolkit==3.0.29 - psutil==5.9.1 - ptyprocess==0.7.0 - pure-eval==0.2.2 - py==1.11.0 - pycparser==2.21 - pygments==2.12.0 - pyopenssl==22.0.0 - pyparsing==3.0.9 - pyrsistent==0.18.1 - pysocks==1.7.1 - pytest==7.1.2 - pytest-cov==3.0.0 - pytest-tornasync==0.6.0.post2 - python-dateutil==2.8.2 - pyzmq==23.0.0 - requests==2.27.1 - requests-unixsocket==0.3.0 - selenium==4.1.5 - send2trash==1.8.0 - six==1.16.0 - sniffio==1.2.0 - sortedcontainers==2.4.0 - soupsieve==2.3.2.post1 - stack-data==0.2.0 - terminado==0.15.0 - testpath==0.6.0 - tinycss2==1.1.1 - tomli==2.0.1 - tornado==6.1 - traitlets==5.2.1.post0 - trio==0.20.0 - trio-websocket==0.9.2 - urllib3==1.26.9 - wcwidth==0.2.5 - webencodings==0.5.1 - websocket-client==1.3.2 - wsproto==1.1.0 prefix: /home/rreyes/miniconda3/envs/ci_tests
davidbrochart commented 2 years ago

Thanks @RRosio, could you point to the failing tests (I assume it's reproducible in a CI)?

RRosio commented 2 years ago

Hi @davidbrochart yes sorry about that, this is the failing test in the nbclassic JS test workflow.