Skip to content

Commit 4808bfb

Browse files
committed
Address review comments
Signed-off-by: senthil <cendhu@gmail.com>
1 parent a637676 commit 4808bfb

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

utils/connection/retry.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func (p *RetryProfile) NewBackoff() *backoff.ExponentialBackOff {
105105
//
106106
// (1) UNAVAILABLE The service is currently unavailable (e.g., transient network issue, server down).
107107
// (2) DEADLINE_EXCEEDED Operation took too long (deadline passed).
108+
// (3) RESOURCE_EXHAUSTED Some resource (e.g., quota) has been exhausted; the operation cannot proceed.
108109
func (p *RetryProfile) MakeGrpcRetryPolicyJSON() string {
109110
// We initialize a backoff object to fetch the default values.
110111
b := p.NewBackoff()
@@ -129,6 +130,7 @@ func (p *RetryProfile) MakeGrpcRetryPolicyJSON() string {
129130
"retryableStatusCodes": []string{
130131
"UNAVAILABLE",
131132
"DEADLINE_EXCEEDED",
133+
"RESOURCE_EXHAUSTED",
132134
},
133135
},
134136
}},

utils/connection/retry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestGrpcRetryJSON(t *testing.T) {
139139
"backoffMultiplier": 1.5,
140140
"initialBackoff": "0.5s",
141141
"maxBackoff": "10s",
142-
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
142+
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED", "RESOURCE_EXHAUSTED",]
143143
}
144144
}]
145145
}`

utils/connection/server_util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ func NewLocalHostServer() *ServerConfig {
4646

4747
// GrpcServer instantiate a [grpc.Server].
4848
func (c *ServerConfig) GrpcServer() *grpc.Server {
49-
opts := append([]grpc.ServerOption{}, grpc.MaxRecvMsgSize(maxMsgSize))
50-
opts = append(opts, grpc.MaxSendMsgSize(maxMsgSize))
49+
opts := []grpc.ServerOption{grpc.MaxRecvMsgSize(maxMsgSize), grpc.MaxSendMsgSize(maxMsgSize)}
5150
if c.Creds != nil {
5251
cert, err := tls.LoadX509KeyPair(c.Creds.CertPath, c.Creds.KeyPath)
5352
utils.Must(err)

0 commit comments

Comments
 (0)