Skip to content

Prevent poll backpressure from starving other task kinds - #67

Merged
rmcdaniel merged 1 commit into
mainfrom
fix/poll-backpressure-fairness
Sep 11, 2026
Merged

Prevent poll backpressure from starving other task kinds#67
rmcdaniel merged 1 commit into
mainfrom
fix/poll-backpressure-fairness

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Addresses #66.

The PHP worker can remain in one task-kind retry loop indefinitely after a typed HTTP 429 long_poll_capacity_exhausted refusal, starving activities and queries despite successful heartbeats.

After the existing interruptible backoff, return that validated empty-task refusal to tick() so the other task kinds get a turn. No lease was acquired. Ambiguous connection/database/storage failures retain their existing retry identity and handling; no Server admission setting or wait deadline changes.

Verification

  • Published 2.0.1 and 2.0.9 negative controls: 17 workflow polls, 11 heartbeats, zero activity/query polls over 60 simulated seconds.
  • Five new liveness cases fail against the unmodified worker; workflow/activity/query/all refusal directions and activity completion pass with the fix.
  • Shutdown during capacity backoff starts no further poll.
  • Full PHP 8.3 suite: 639 tests, 3,673 assertions, one existing live-runtime memo test skipped because no runtime URL was supplied.
  • PHPStan passes.
  • Python and Rust source inspection shows independent managed polling tasks; Rust also settles an explicit capacity refusal as no task. This is source inspection, not a new runtime conformance pass.

Prepares PHP SDK 2.0.10. Publication, installed-package regression, published service-mode smoke and the Server soak consumer update remain required before issue closure. The short local Server run completed 60/60 workflows without reproducing the six paid-run timeouts; this fix is not claimed as their complete diagnosis. Server investigation: durable-workflow/server#137.

@rmcdaniel
rmcdaniel marked this pull request as ready for review September 11, 2026 15:26
@rmcdaniel
rmcdaniel merged commit 19b2695 into main Sep 11, 2026
33 checks passed
@rmcdaniel

Copy link
Copy Markdown
Member Author

Published follow-through: 2.0.10 is installable from Packagist, source 19b2695. Fresh published-consumer smoke passed: https://github.com/durable-workflow/sdk-php/actions/runs/34616341682 (Server 2.1.0). The installed-package deterministic backpressure reproduction also passed: 60 simulated seconds, 60 workflow polls, 59 activity polls, 59 query polls, 11 heartbeats, graceful shutdown. Both installed older negative controls had zero activity/query polls. The affected Server consumer update is durable-workflow/server#161; no Server runtime dependency or unchanged Python/Rust release is required. The original paid-soak timeout investigation remains separate.

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.

2 participants