Repository navigation
Require ipykernel>=7.4.0 to stop example notebooks hanging in CI - #5905
Merged
Merged
Conversation
ipykernel 7.2/7.3 send shell replies raw on the ROUTER socket that a ZMQStream reads requests from, which can leave an execute_request unread: the kernel sits idle and nbmake times out after 300 s. ipykernel 7.4.0 sends the reply through the stream (ipython/ipykernel#1529). Fixes #5884 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
| Project | PyBaMM |
| Branch | claude/pybamm-issue-5884-df3983 |
| Testbed | bare-metal |
🐰 View full continuous benchmarking report in Bencher
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5905 +/- ##
=======================================
Coverage 98.12% 98.13%
=======================================
Files 348 348
Lines 35578 35578
=======================================
+ Hits 34912 34913 +1
+ Misses 666 665 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The save_custom_model and load_custom_model doctests both wrote basicdfn_model.json in the working directory, so under pytest -nauto one could read the file while the other was rewriting it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valentinsulzer
approved these changes
Oct 14, 2026
rtimms
enabled auto-merge (squash)
October 14, 2026 10:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5884.
Cause
The
Example notebooksjob intermittently times out because of a bug in ipykernel 7.3.0, not in PyBaMM. ipykernel 7.2 and 7.3 send shell replies with a raw send on the ROUTER socket that aZMQStreamreads requests from. That can leave anexecute_requestunread: the kernel sits idle at 0% CPU, never replies, and nbmake waits out its 300 s timeout (ipython/ipykernel#1554). ipykernel 7.4.0 fixes it by sending the reply through the stream (ipython/ipykernel#1529). ipykernel 7.3.0 came in with #5749 on 16 Sep.Evidence
The 20 A re-solve in
lead-acid.ipynbtakes under 1 s and is deterministic; 1,200 looped solves never stalled.Running 24 copies of the notebook through nbmake with 8 workers reproduced the hang locally (3/24, then 1/24). Hung kernels were idle in their event loop, and a faulthandler dump in the cell never fired, so the cell had already finished. One timeout landed on the trivial
pybamm.print_citations()cell.48 copies per batch:
One further 7.4.0 batch had 16 failures whose log was lost to a session restart, so its cause is unknown; the four clean batches came after it.
Change
devextra:ipykernel>=7.4.0; python_version >= '3.11'. ipykernel 7.4 requires Python 3.11+, so 3.10 stays on 7.3.0; the examples job runs on 3.13.uv.lock: only ipykernel changes (7.3.0 for 3.10, 7.4.0 for ≥3.11).The
save_custom_modelandload_custom_modeldoctests both wrotebasicdfn_model.jsonin the working directory, which made the parallel Doctests job fail on this PR. Thesave_custom_modelexample now writesbasicdfn_saved.json.No CHANGELOG entry, as this only changes a dev dependency.
🤖 Generated with Claude Code