This is an automated email from the ASF dual-hosted git repository.

crazyhzm pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 33a29ca  fix #9832 (#9839)
33a29ca is described below

commit 33a29caa0d615edebd3d3db660a0b6cc51e488b3
Author: Wang Chengming <[email protected]>
AuthorDate: Sun Mar 27 12:43:35 2022 +0800

    fix #9832 (#9839)
    
    Co-authored-by: 呈铭 <[email protected]>
---
 .../java/org/apache/dubbo/rpc/filter/ProfilerServerFilter.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ProfilerServerFilter.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ProfilerServerFilter.java
index 3dba1d1..f1d8d11 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ProfilerServerFilter.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ProfilerServerFilter.java
@@ -75,21 +75,21 @@ public class ProfilerServerFilter implements Filter, 
BaseFilter.Listener {
                 ProfilerEntry profiler = Profiler.release((ProfilerEntry) 
fromInvocation);
                 invocation.put(Profiler.PROFILER_KEY, profiler);
 
-                dumpIfNeed(invoker, invocation,(ProfilerEntry) fromInvocation);
+                dumpIfNeed(invoker, invocation, (ProfilerEntry) 
fromInvocation);
             }
         }
     }
 
     private void dumpIfNeed(Invoker<?> invoker, Invocation invocation, 
ProfilerEntry profiler) {
         int timeout;
-        Object timeoutKey = 
invocation.getObjectAttachmentWithoutConvert(TIMEOUT_KEY);
-        if (timeoutKey instanceof Integer) {
-            timeout = (Integer) timeoutKey;
+        Object timeoutValue = 
invocation.getObjectAttachmentWithoutConvert(TIMEOUT_KEY);
+        if (timeoutValue instanceof Integer) {
+            timeout = (Integer) timeoutValue;
         } else {
             timeout = 
invoker.getUrl().getMethodPositiveParameter(invocation.getMethodName(), 
TIMEOUT_KEY, DEFAULT_TIMEOUT);
         }
         long usage = profiler.getEndTime() - profiler.getStartTime();
-        if ((usage / (1000_000L * ProfilerSwitch.getWarnPercent())) > timeout) 
{
+        if (((usage / (1000_000L * ProfilerSwitch.getWarnPercent())) > 
timeout) && timeout != -1) {
 
             StringBuilder attachment = new StringBuilder();
             for (Map.Entry<String, Object> entry : 
invocation.getObjectAttachments().entrySet()) {

Reply via email to