chenBright commented on PR #2273:
URL: https://github.com/apache/brpc/pull/2273#issuecomment-1595765049
> > Hi,
> > Since `Retry_backoff_policy` or `Backoff_retry_policy` **IS A** Retry
policy, it is not a good idea that both policies exist in channel,
> > ```
> > , retry_policy(NULL)
> > , retry_backoff_policy(NULL)
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > It is better that retry_backoff_policy inherits basic interface in a
manner of :
> > ```
> > class BackoffRetryPolicy : public RetryPolicy {
> > bool DoRetry(const Controller* controller) const {
> > // details in backoff policy
> > }
> > }
> > ```
>
> @thorneliu Good idea. Maybe These virtual functions can be added to
RetryPolicy with default implementation that the retry backoff feature is
turned off. In a manner of:
>
> ```c++
> class RetryPolicy {
> public:
> virtual ~RetryPolicy();
> virtual bool DoRetry(const Controller* controller) const = 0;
> virtual int32_t GetBackoffTimeMs(const Controller* controller, int
nretry,
> int64_t remaining_rpc_time_ms) const
{ return 0; }
> virtual bool CanRetryBackoffInPthread() const { return false; }
> };
> ```
>
> `FixedRetryBackoffPolicy` and `JitteredRetryBackoffPolicy` inherit
`RpcRetryPolicy` which implements the default rpc retry policy.
@thorneliu New implementationhas been updated. Could you spare some tine to
review it again and offer any additional input?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]