Commit af8768c
authored
fix(dagster-async-executor): bound event receive so delayed retries don't hang (#327)
* chore(dagster-async-executor): add pytest-timeout dev dep, de-dupe pytest
Remove the duplicate `pytest` entry from `[dependency-groups].dev` and add
`pytest-timeout` (needed by upcoming regression test for the delayed retry hang).
Regenerated `uv.lock` — resolves to pytest-timeout v2.4.0.
Generated with AI
Co-Authored-By: Claude Code
* test(dagster-async-executor): add regression test for delayed-retry hang
Add test_retry_policy.py with a 30-second pytest-timeout guard that
reproduces the hang caused by recv_stream.receive() blocking forever
when the last step is parked in _waiting_to_retry under a delayed
RetryPolicy. Pre-fix: test times out via pytest-timeout (RED).
Generated with AI
Co-Authored-By: Claude Code
* fix(dagster-async-executor): resolve delayed-retry hang via bounded receive()
When the last in-flight step emits STEP_UP_FOR_RETRY under a RetryPolicy
with delay > 0, the step is parked in ActiveExecution._waiting_to_retry.
No worker is alive to emit an event, so recv_stream.receive() blocks
forever while active.is_complete stays False — the run wedges in STARTED.
Fix: wrap receive() in anyio.move_on_after(sleep_interval()) so the wait
is bounded by the retry backoff. When the timeout fires (scope.cancelled_caught),
continue to re-poll, which runs get_steps_to_execute() → _update() to promote
the now-ready retry step. When sleep_interval() == 0 (hot path), we pass None
to move_on_after, preserving exact current behavior. The removed
try/except anyio.EndOfStream: raise was a no-op; EndOfStream is still handled
by _drain_events after the loop.
Mirroring stock in_process/multiprocess executors' sleep_til_ready() pattern.
Generated with AI
Co-Authored-By: Claude Code
* test(dagster-async-executor): make retry test xdist-safe via config_schema
Replace fixed global temp filename with per-test TemporaryDirectory and
thread the attempts-file path into the op through config_schema + run_config,
eliminating shared-state races under pytest-xdist parallel runs.
Generated with AI
Co-Authored-By: Claude Code1 parent fe4d102 commit af8768c
4 files changed
Lines changed: 85 additions & 5 deletions
File tree
- libraries/dagster-async-executor
- dagster_async_executor_tests
- dagster_async_executor
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
242 | 252 | | |
243 | | - | |
244 | | - | |
| 253 | + | |
| 254 | + | |
245 | 255 | | |
246 | 256 | | |
247 | 257 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments