Skip to content

Commit 2d3f779

Browse files
authored
Merge pull request #39 from HarrisChu/enhance_retry
enhance retry error message
2 parents f4ff08c + fa3f129 commit 2d3f779

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/nebulagraph/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (gp *GraphPool) InitWithSize(address string, concurrent int, chanSize int)
117117
}
118118

119119
if retryTimes == 0 {
120-
retryTimes = 50
120+
retryTimes = 200
121121
}
122122

123123
err := gp.initAndVerifyPool(address, concurrent, chanSize)
@@ -263,7 +263,6 @@ func (gc *GraphClient) executeRetry(stmt string) (*graph.ResultSet, error) {
263263
graphErr := resp.GetErrorCode()
264264
if graphErr != graph.ErrorCode_SUCCEEDED {
265265
if graphErr == graph.ErrorCode_E_EXECUTION_ERROR {
266-
fmt.Printf("execute error: %s, code: %d, retry %d times\n", resp.GetErrorMsg(), graphErr, i+1)
267266
<-time.After(100 * time.Millisecond)
268267
continue
269268
}
@@ -272,7 +271,7 @@ func (gc *GraphClient) executeRetry(stmt string) (*graph.ResultSet, error) {
272271
return resp, nil
273272
}
274273
// still leader changed
275-
fmt.Printf("retry %d times, but still leader changed, return directly\n", gc.Pool.retryTimes)
274+
fmt.Printf("retry %d times, but still error: %s, return directly\n", gc.Pool.retryTimes, resp.GetErrorMsg())
276275
return resp, nil
277276
}
278277

0 commit comments

Comments
 (0)