MCPcopy Create free account
hub / github.com/apache/brpc / DoRetry

Method DoRetry

src/brpc/retry_policy.cpp:25–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace brpc {
24
25bool RpcRetryPolicy::DoRetry(const Controller* controller) const {
26 const int error_code = controller->ErrorCode();
27 if (!error_code) {
28 return false;
29 }
30 return (EFAILEDSOCKET == error_code
31 || EEOF == error_code
32 || EHOSTDOWN == error_code
33 || ELOGOFF == error_code
34 || ETIMEDOUT == error_code // This is not timeout of RPC.
35 || ELIMIT == error_code
36 || ENOENT == error_code
37 || EPIPE == error_code
38 || ECONNREFUSED == error_code
39 || ECONNRESET == error_code
40 || ENODATA == error_code
41 || EOVERCROWDED == error_code
42 || EH2RUNOUTSTREAMS == error_code);
43}
44
45// NOTE(gejun): g_default_policy can't be deleted on process's exit because
46// client-side may still retry and use the policy at exit

Callers 1

Calls 1

ErrorCodeMethod · 0.80

Tested by

no test coverage detected