mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
<!-- Describe what has changed in this PR --> **What changed?** This adds configurable behavior for the history client to cache shard ownership information, instead of checking membership for each request. Cache entries are evicted either for shard ownership lost errors, or for any error that might indicate the history instance is no longer available, including timeouts. The new behavior is not enabled by default. <!-- Tell your future self why have you made these changes --> **Why?** History requests could timeout awaiting shard acquisition at a new owner, even though the old owner still has ownership. By continuing to send requests to owners until they signal ownership lost, we can avoid the unnecessary timeouts and retries. <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> **How did you test it?** New unit tests are added & verified. These changes were also tested in a staging environment. <!-- Assuming the worst case, what can be broken when deploying this change to production? --> **Potential risks** The behavior is not enabled by default, so there's no risk with just the code in place. <!-- Is this PR a hotfix candidate or require that a notification be sent to the broader community? (Yes/No) --> **Is hotfix candidate?** No.