Honor a timeout of 0 in get_many instead of polling forever (#10524)
* Honor a timeout of 0 in get_many instead of polling forever
The deadline in KeyValueStoreBackend.get_many was guarded with
"if timeout and ...", so a timeout of 0 was falsy and skipped on every
pass, and it was counted in whole intervals, so any timeout below the
poll interval was rounded up to one interval.
Applies the same two changes #10487 made to SyncBackendMixin.wait_for:
check against None, and never sleep past what is left of the budget.
* Potential fix for pull request finding
* Cover the get_many completion short-circuit with tests
Comment the break so the ordering does not read as incidental: wait_for
does the same thing, returning a ready result before it looks at the
deadline.
Two unit tests pin the short-circuit directly. Two integration tests in
test_result_set drive it through join_native against a live key/value
backend, skipped when the backend is not one.
---------
Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com> D
Dylan Pulver committed
1ea3d4f6408e7521a95c6bca3bbcbf502bcb62ec
Parent: 8ea291f
Committed by GitHub <noreply@github.com>
on 9/1/2026, 7:44:42 AM