This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.2 by this push:
new 5f83f10eac Fix shutdown timeout override (#12648)
5f83f10eac is described below
commit 5f83f10eac965201968a02248e13e762c19e9086
Author: Albumen Kevin <[email protected]>
AuthorDate: Mon Jul 3 11:22:36 2023 +0800
Fix shutdown timeout override (#12648)
---
.../java/org/apache/dubbo/common/config/ConfigurationUtils.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java
index 73c189dae7..043cdd9e78 100644
---
a/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java
+++
b/dubbo-common/src/main/java/org/apache/dubbo/common/config/ConfigurationUtils.java
@@ -146,16 +146,19 @@ public final class ConfigurationUtils {
return timeout;
}
- public static int reCalShutdownTime(int expectedShutdownTime) {
+ public static int reCalShutdownTime(int expected) {
+ // already timeout
if (expectedShutdownTime < System.currentTimeMillis()) {
return 1;
}
- if (expectedShutdownTime - System.currentTimeMillis() <
expectedShutdownTime) {
+ if (expectedShutdownTime - System.currentTimeMillis() < expected) {
+ // the shutdown time rest is less than expected
return (int) Math.max(1, expectedShutdownTime -
System.currentTimeMillis());
}
- return expectedShutdownTime;
+ // return the expected
+ return expected;
}
public static void setExpectedShutdownTime(long expectedShutdownTime) {