You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by yi...@apache.org on 2025/09/06 13:49:10 UTC
(dubbo-go) branch fix/endcount_not_invoke created (now 4586d5833)
This is an automated email from the ASF dual-hosted git repository.
yizhenqiang pushed a change to branch fix/endcount_not_invoke
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
at 4586d5833 fix: Fixed an issue where the counter was not decremented when an error occurred in the OnResponse dubboInvokeStartTime conversion (although the current code does not seem to cause an error).
This branch includes the following new commits:
new 4586d5833 fix: Fixed an issue where the counter was not decremented when an error occurred in the OnResponse dubboInvokeStartTime conversion (although the current code does not seem to cause an error).
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(dubbo-go) 01/01: fix: Fixed an issue where the counter was not decremented when an error occurred in the OnResponse dubboInvokeStartTime conversion (although the current code does not seem to cause an error).
Posted by yi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yizhenqiang pushed a commit to branch fix/endcount_not_invoke
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
commit 4586d583335553c90820dfbf6678612723f9806b
Author: yizhenqiang <yi...@apache.org>
AuthorDate: Sat Sep 6 21:48:55 2025 +0800
fix: Fixed an issue where the counter was not decremented when an error occurred in the OnResponse dubboInvokeStartTime conversion (although the current code does not seem to cause an error).
Fixes: #3012
---
filter/active/filter.go | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/filter/active/filter.go b/filter/active/filter.go
index ce72025ce..949e603c0 100644
--- a/filter/active/filter.go
+++ b/filter/active/filter.go
@@ -71,12 +71,23 @@ func (f *activeFilter) Invoke(ctx context.Context, invoker base.Invoker, inv bas
// OnResponse update the active count base on the request result.
func (f *activeFilter) OnResponse(ctx context.Context, result result.Result, invoker base.Invoker, inv base.Invocation) result.Result {
startTime, err := strconv.ParseInt(inv.(*invocation.RPCInvocation).GetAttachmentWithDefaultValue(dubboInvokeStartTime, "0"), 10, 64)
+
+ defer func() {
+ if err != nil {
+ // This err common is nil,when if not nil set a default elapsed value 1
+ base.EndCount(invoker.GetURL(), inv.MethodName(), 1, false)
+ return
+ }
+
+ elapsed := base.CurrentTimeMillis() - startTime
+ base.EndCount(invoker.GetURL(), inv.MethodName(), elapsed, result.Error() == nil)
+ }()
+
if err != nil {
result.SetError(err)
logger.Errorf("parse dubbo_invoke_start_time to int64 failed")
return result
}
- elapsed := base.CurrentTimeMillis() - startTime
- base.EndCount(invoker.GetURL(), inv.MethodName(), elapsed, result.Error() == nil)
+
return result
}