Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gateway kernel shutdown #874

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

kevin-bates
Copy link
Member

While working on the next Enterprise Gateway release, I ran into a couple of issues encountered when shutting down Jupyter Server when a Gateway is configured and there are outstanding kernel instances.

  1. The loop walking the set of outstanding kernels was being modified producing "RuntimeError: dictionary changed size during iteration".
  2. Attempts to delete a kernel known to Server but unknown to Gateway (due to culling or inadvertent termination on the gateway) was triggering an exception for the 404 when, for shutdown operations, this can be ignored.

This pull request addresses these issues and adds an appropriate test as well. (I confirmed expected test failures prior to applying the fixes.)

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2022

Codecov Report

Merging #874 (528ab42) into main (29911b1) will increase coverage by 0.07%.
The diff coverage is 61.53%.

@@            Coverage Diff             @@
##             main     #874      +/-   ##
==========================================
+ Coverage   70.18%   70.25%   +0.07%     
==========================================
  Files          65       65              
  Lines        7680     7683       +3     
  Branches     1283     1284       +1     
==========================================
+ Hits         5390     5398       +8     
+ Misses       1902     1897       -5     
  Partials      388      388              
Impacted Files Coverage Δ
jupyter_server/gateway/managers.py 59.79% <61.53%> (+1.87%) ⬆️
jupyter_server/services/kernels/kernelmanager.py 78.31% <0.00%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29911b1...528ab42. Read the comment docs.

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit d901415 into jupyter-server:main Jun 15, 2022
@blink1073
Copy link
Contributor

@meeseeksdev please backport to 1.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyter_server that referenced this pull request Jun 15, 2022
blink1073 pushed a commit that referenced this pull request Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants