You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Grant the configured number of retries, and drop the at_exit wakeup
Two fixes.
RetryBudget decremented @retries_remaining before testing it, so one retry
was spent on the exhaustion check itself: a configured N performed N-1, and
retries: 1 and retries: 0 both performed none. go, python and java all
grant N. The existing spec asserted `.exactly(retries - 1).times`, so it
codified the bug and would have passed either way; it now asserts N, and
the new retry_budget_spec covers the 1-and-0 cases that were previously
indistinguishable. Both fail without this change.
The at_exit block called Thread#wakeup on the worker. That raises
ThreadError if the thread finished between the alive? check and the call,
and an unrescued raise inside at_exit forces the process to exit 1 — a
spurious failure for any script or CI step using this client. Reproduced
under the pinned ruby 3.2.
Rescuing the error would have left the other half broken: wakeup only cuts
short a sleep already in progress, so one arriving while the worker is
mid-request is lost and the next sleep runs in full, which is the hang the
wakeup was added to prevent. The retry wait is now sliced and checks
should_exit between slices, so shutdown is noticed within a second without
needing wakeup at all. Same shape as python's interruptible wait.
Specs stub the new interruptible_sleep seam instead of sleep, and must
return truthy — a nil return reads as "shutting down" and stops the retry.
Metrics/ClassLength for transport.rb goes 155 -> 161. Regenerating
.rubocop_todo.yml as the repo's CLAUDE.md suggests rewrote ~100 unrelated
lines (rubocop 1.90 against a file generated by 1.44, plus e2e-cli files
that were not previously inspected), so this is the minimal edit instead.
210 examples pass, rubocop is clean on lib and spec, and the 61-test e2e
suite passes.
0 commit comments