Skip to content

Stop the ISRM tutorial's run_isrm from hanging on a silent worker - #124

Merged
ctessum merged 1 commit into
masterfrom
blog/isrm-esm-watch-fallback
Oct 15, 2026
Merged

ctessum merged 1 commit into
masterfrom
blog/isrm-esm-watch-fallback

Conversation

@ctessum

@ctessum ctessum commented Oct 15, 2026

Copy link
Copy Markdown
Member

Summary

run_isrm in the ISRM on EarthSciLab tutorial could hang forever. The EarthSciLab event stream sends a keep-alive every 15 s, so watch()'s 240 s socket timeout never fires on a quiet stream, and watch() only checks GET /runs/{id} after the stream drops. When a cloud worker died without reporting back, nothing ever ended the wait.

watch() now checks the run directly after 60 s with no real event, and returns if the run has ended. The change is identical in the post's code block (website/blog/2026-09-09-isrm-esm.md) and in its notebook copy (website/static/blog/2026-09-09-isrm-esm/isrm_esm.ipynb). It is the same as EarthSciML/isrm.esm@dbf4b12.

The EarthSciLab server has also been fixed so the event stream itself reports a dead worker as failed within about 30 s. With that deployed, this change is a second safeguard rather than the only fix.

Testing

  • Offline: a fake stream that sends only keep-alives makes watch() return failed after one status check, about 75 s in.
  • The notebook JSON still parses, and both files differ from master only by the 17 added lines.

🤖 Generated with Claude Code

The EarthSciLab event stream sends a keep-alive every 15 s, so watch()'s
240 s socket timeout never fired on a quiet stream and it never fell back to
GET /runs/{id}. When a cloud worker died without reporting back, run_isrm
waited forever. After 60 s with no real event, watch() now checks the run
directly and returns if it has ended.

Same change as EarthSciML/isrm.esm dbf4b12, in both the post's code block and
its notebook copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ctessum
ctessum merged commit 3877d43 into master Oct 15, 2026
2 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant