AlexStocks commented on a change in pull request #1718:
URL: https://github.com/apache/dubbo-go/pull/1718#discussion_r786414211
##########
File path: cluster/cluster/adaptivesvc/cluster_invoker.go
##########
@@ -67,8 +68,20 @@ func (ivk *adaptiveServiceClusterInvoker) Invoke(ctx
context.Context, invocation
// invoke
result := invoker.Invoke(ctx, invocation)
+ // if the adaptive service encounters an error, DO NOT
+ // update the metrics.
+ if clsutils.IsAdaptiveServiceFailed(result.Error()) {
+ return result
+ }
+
// update metrics
- remainingStr := result.Attachment(constant.AdaptiveServiceRemainingKey,
"").(string)
+ remainingIface :=
result.Attachment(constant.AdaptiveServiceRemainingKey, "")
+ remainingStr, ok := remainingIface.(string)
+ if !ok {
+ logger.Errorf("[adasvc cluster] The %s field is not expectedly,
the value is %v, we expect a string",
Review comment:
The %s field type of value %v should be string
--
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]