Hyeonsang Cho a0c3968f28
fix(channels): publish failed-run replies before releasing the dedupe key (#8383)
* fix(channels): publish failed-run replies before releasing the dedupe key

The generic error handler, both thread-busy replies and the /wait
stale-pin recovery released the inbound dedupe key before publishing
their reply. Publishing awaits the channel's send, so a provider
redelivery could start over on another worker while that reply was
still on its way. Publish first, then release, as the step-limit,
fire-and-forget stale-pin and streaming paths already do.

* fix(channels): release the dedupe key when shutdown cancels a failure reply

The release decision is made from the run's own failure before the reply,
and a reply that is cancelled or raises still releases the key, so shutdown
no longer turns a rejected run into a key kept for the dedupe TTL. A /wait
read timeout still keeps the key. The ordering tests wait for inbound
completion and always stop the manager.
2026-11-20 10:13:20 +08:00
..