Files
tasks/client/matching/retryable_client.go
David ReissandGitHub 7cda953206 Allow more retries for matching client polls (#8155)
## What changed?
Allow frontend->matching poll requests to retry up to their context
timeout instead of just once.

## Why?
On matching service deployments, a busy new matching node may hit its
persistence rps limit trying to acquire new task queues and be unable to
accept polls.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-08-19 06:51:19 -07:00

31 lines
798 B
Go

package matching
import (
"go.temporal.io/server/api/matchingservice/v1"
"go.temporal.io/server/common/backoff"
)
var _ matchingservice.MatchingServiceClient = (*retryableClient)(nil)
type retryableClient struct {
client matchingservice.MatchingServiceClient
policy backoff.RetryPolicy
pollPolicy backoff.RetryPolicy
isRetryable backoff.IsRetryable
}
// NewRetryableClient creates a new instance of matchingservice.MatchingServiceClient with retry policy
func NewRetryableClient(
client matchingservice.MatchingServiceClient,
policy,
pollPolicy backoff.RetryPolicy,
isRetryable backoff.IsRetryable,
) matchingservice.MatchingServiceClient {
return &retryableClient{
client: client,
policy: policy,
pollPolicy: pollPolicy,
isRetryable: isRetryable,
}
}