GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Stop the watchdog at exit (0.9.1) by davidackerman · Pull Request #15 · JaneliaSciComp/worldarray

Conversation

@davidackerman

@davidackerman davidackerman commented Oct 26, 2026

Copy link
Copy Markdown
Member

A process could abort at exit after all its work was done: "terminate called without an active exception", exit 134. mesh-n-bone's Linux CI hit it once in six runs (run 40388119893, Python 3.12.13, tensorstore 0.1.82, right after "342 passed"). An LSF job that does this looks failed.

Cause. Python up to 3.13 ends a daemon thread that takes the GIL back during finalization with pthread_exit. If the thread is inside a tensorstore call at that moment, the forced unwind goes through a C++ frame that may not throw, and the process aborts. The worldarray-kick thread is such a daemon thread. Locally (Python 3.10, tensorstore 0.1.78), a process that exits while the watchdog kicks flat out and finalization takes a while aborts 20 times in 20. An array read, a missing-key kvstore read and an open each abort the same way. A daemon thread only waiting in Future.result does not.

Fix. An atexit handler ends the watchdog thread and waits for it, at most the longest one kick takes. Python runs it once the program's other threads are joined, so they are kicked to the end, and before finalization. watch() starts no new thread after that. The thread now waits on an event instead of time.sleep, so it stops at once. With the fix the same process exits 0 in 20 of 20.

  • tests/test_access.py::test_a_process_exits_cleanly_while_the_watchdog_kicks runs that process. It fails on 0.9.0 (SIGABRT, 3 of 3) and passes here.
  • 193 passed, 1 skipped on tensorstore 0.1.78 and 0.1.68. The WORLDARRAY_STRESS=1 lost-wakeup test still passes: a plain context stranded 13 tasks, the watched one stranded 0, slowest 0.95 s.
  • Spec Behaviour 6 and §5, CHANGELOG 0.9.1, version 0.9.1.

https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@davidackerman
Stop the watchdog at exit (0.9.1)
5c8997e
On Python up to 3.13 a daemon thread that takes the GIL back during
finalization is ended with pthread_exit, and inside a tensorstore call
that aborts the process: "terminate called without an active
exception", exit 134, after all the work is done. mesh-n-bone's Linux
CI hit it once in six runs on Python 3.12; a process exiting while the
watchdog kicks flat out hits it every time.

An atexit handler, which runs once the program's other threads are
joined and before finalization, now ends the watchdog thread and waits
for it, and watch() starts no new one after that.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
@davidackerman
davidackerman merged commit bde4524 into main Oct 26, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@davidackerman
davidackerman deleted the watchdog-exit-0.9.1 branch October 26, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@davidackerman
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.