SIGN IN SIGN UP

fix(queue): renew capacity leases before dispatch (#4766)

## Description

Prevent key-queue items from starting with a capacity lease that can
expire before the first renewal tick.

Near-expiry leases are now renewed synchronously before item dispatch,
using a reuse threshold based on the configured renewal interval plus a
safety margin. If the renewal fails or returns no replacement lease, the
item is not dispatched. Processing also watches the active lease expiry
and cancels and requeues the item if renewal is not confirmed in time.

Adds a Redis-backed integration regression test for overlapping steps at
concurrency one, plus focused coverage for pre-dispatch renewal failure
and runtime expiry.

## Release note

Fixed an issue where steps using key queues could overlap despite a
concurrency limit of one when a pre-acquired capacity lease expired
before its first renewal.

## Migration note

None.
B
Bruno Scheufler committed
253303cdffec27f6c70e208114305326baaa5dd7
Parent: 0284bbf
Committed by GitHub <noreply@github.com> on 8/22/2026, 12:35:37 AM