Skip to content

Improve task timeout handling - #48

Merged
vikranthreddimasu merged 3 commits into
masterfrom
improve-task-timeout-errors
Jul 18, 2026
Merged

vikranthreddimasu merged 3 commits into
masterfrom
improve-task-timeout-errors

Conversation

@vikranthreddimasu

@vikranthreddimasu vikranthreddimasu commented Jul 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Added task ids and timeout values to TaskFuture.result() timeout errors.
  • Prevented TaskWorker.stop() from blocking on already timed-out task threads.
  • Made registered-task Pool.map() honor max_workers, preserve result order, and enforce bounded timeout behavior.
  • Documented registered-task timeout and local parallelism behavior.

Security changes

  • No authentication, authorization, credential, token, or destructive-action behavior changed.
  • The default registered-task path still uses task names and msgpack-native args; no pickle fallback was broadened.

Usability changes

  • Timeout failures now identify the task and configured timeout instead of surfacing blank timeout errors.
  • Single-Mac registered Pool.submit() and Pool.map() now fail fast when task timeout expires.
  • Pool.map(..., max_workers=...) now matches documented behavior for registered tasks.

Tests/checks run

  • python -m pytest tests/test_compute/test_models.py::TestTaskFuture::test_result_timeout tests/test_compute/test_dispatch.py::TestDispatcherWorkerIntegration::test_worker_stop_returns_after_timed_out_task tests/test_compute/test_pool_compute.py::TestPoolSubmit::test_submit_timeout_is_enforced_for_registered_task -q — 3 passed
  • python -m pytest tests/test_compute/test_pool_compute.py -q — 19 passed
  • python -m pytest tests/test_compute/ -q — 109 passed
  • make lint — ruff passed; mypy passed
  • make test — 1023 passed, 2 warnings
  • GitHub Actions — 11/11 checks passed
  • git diff --check master...HEAD — clean
  • Diff-only secret scan — no matches

Commits

  • 6073b41 Harden task timeout handling
  • a533a68 Honor registered task map parallelism
  • f7958fc Document task timeout behavior

Risks / manual review notes

  • Low risk. Changes are limited to task timeout handling, local registered task execution, and docs.
  • Timed-out local registered task threads may continue until user code returns; callers now regain control promptly.

Merge status

  • Merged into master after local validation, clean secret scan, clean mergeability check, and 11/11 passing GitHub Actions checks.

@vikranthreddimasu
vikranthreddimasu merged commit ec66a05 into master Jul 18, 2026
11 checks passed
@vikranthreddimasu
vikranthreddimasu deleted the improve-task-timeout-errors branch July 18, 2026 07:11
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