Tags: temporalio/temporal
Tags
Recycle task tokens for invalid matching tasks (#6599) ## What changed? Add a `RecycleToken` function to our custom rate limiters. It seems that most of the rate limiters just wrap the `ClockedRateLimiter`, so let the `ClockedRateLimiter`'s `WaitN` function unblock the waiter if recycle is called, thus allowing us to recycle tokens and give them to any waiters if they exist. ## Why? Lots of invalid tasks combined with Activity task dispatch rate limiting can cause the actual rate to be noticeably below the maximum rate. This will make the actual rate match the max rps, as long as `time_to_recycle` is reasonably short and `recycle_rate` is reasonable (see discussion in the comments) ## How did you test it? ClockedRateLimiter unit test. ## Potential risks The max Activity RPS could break. ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> --------- Co-authored-by: David Reiss <[email protected]>
Fix SyncMap.PopAll if SyncMap is copied (#6557) ## What changed? Change SyncMap.PopAll to clone+clear the contained map instead of creating a new one. ## Why? Swapping the map makes SyncMap not copyable, and it's intended to be copyable (like a regular map reference). ## How did you test it? existing test
Fix SyncMap.PopAll if SyncMap is copied (#6557) ## What changed? Change SyncMap.PopAll to clone+clear the contained map instead of creating a new one. ## Why? Swapping the map makes SyncMap not copyable, and it's intended to be copyable (like a regular map reference). ## How did you test it? existing test
PreviousNext