ipykernel ignore signals

Open
#946 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, docker-compose, jupyter-notebook, python

Research direction

Start by reproducing the signal behavior with the python -m ipykernel --config=./ipykernel_conf.py command and the provided Docker Compose settings. Trace signal handling from the python -m ipykernel entry point, then verify that TERM and QUIT produce the intended shutdown behavior in Docker.

Written by the indexing model from the issue text.

Description

Runned as server in Docker:

$ kill -QUIT 1
$ kill -TERM 1
$ kill -KILL 1
$ ps
PID   USER     TIME  COMMAND
    1 usr       0:01 /usr/local/bin/python -m ipykernel --config=./ipykernel_conf.py

in docker-compose.yml:

services:
  ipykernel:
    command: ["/usr/local/bin/python", "-m", "ipykernel", "--config=./ipykernel_conf.py"]
    stop_signal: "SIGQUIT"
    stop_grace_period: "10s"

In my other script, I register a signal to break the loop. But I did not find this code in ipykernel.

import signal
import time

ISRUN = True

def sighandler(signum, frame):
    global ISRUN
    ISRUN = False
signal.signal(signal.SIGTERM, sighandler)
signal.signal(signal.SIGQUIT, sighandler)

while ISRUN:
    time.sleep(1)
Dominant language
Python
Stars
734
Forks
411
Avg merge
1d 2h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ipython/ipykernel

All issues in ipython/ipykernel

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.