-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FailbackClusterInvoker one risk of memory leak #2425 #2822
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2822 +/- ##
==========================================
- Coverage 64.38% 64.35% -0.03%
==========================================
Files 584 584
Lines 26084 26111 +27
Branches 4559 4564 +5
==========================================
+ Hits 16795 16805 +10
- Misses 7111 7122 +11
- Partials 2178 2184 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would u mind add some ut such as verify that the new configuration is in effect in the URL.
dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
Outdated
Show resolved
Hide resolved
@@ -139,6 +139,10 @@ | |||
|
|||
public static final int DEFAULT_RETRIES = 2; | |||
|
|||
public static final int DEFAULT_FAIL_CAPACITY_SIZE = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- DEFAULT_FAIL_CAPACITY_SIZE maybe changed to DEFAULT_FAILBACK_TASKS
2.1000 is to large to us. maybe 100 is enough.
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I've changed it.
dubbo-common/src/main/java/org/apache/dubbo/common/Constants.java
Outdated
Show resolved
Hide resolved
|
||
private final ConcurrentMap<Invocation, AbstractClusterInvoker<?>> failed = new ConcurrentHashMap<>(); | ||
private volatile ScheduledFuture<?> retryFuture; | ||
private final int failCapacitySize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe 'failbackTasks'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I've changed it.
dubbo-common/src/main/java/org/apache/dubbo/common/Constants.java
Outdated
Show resolved
Hide resolved
@beiwei30 @chickenlj |
fef8612
to
5feea92
Compare
Hi, @wangweiufofly |
test case completed |
232a4f8
to
ad6114e
Compare
invoker.retryFailed();// when retry the invoker which get from failed map already is not the mocked invoker,so | ||
// invoker.retryFailed();// when retry the invoker which get from failed map already is not the mocked invoker,so | ||
//Ensure that the main thread is online | ||
CountDownLatch countDown = new CountDownLatch(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think u should assert that the logger contains the specific msg.
…pacity 2.retry period,default is 100.can config by key retries. 3.shutdown the timer when destroyed
…pacity 2.retry period,default is 100.can config by key retries. 3.shutdown the timer when destroyed
2.add test case.
…pacity 2.retry period,default is 100.can config by key retries. 3.shutdown the timer when destroyed
…pacity 2.retry period,default is 100.can config by key retries. 3.shutdown the timer when destroyed
ad6114e
to
c132209
Compare
invoker.invoke(invocation); | ||
assertEquals(1, LogUtil.findMessage("Failback to invoke")); | ||
LogUtil.stop(); | ||
} | ||
|
||
@Test() | ||
public void testRetryFailed() { | ||
public void testARetryFailed() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could u pls tell us why u rename the method and why u add the FixMethodOrder annotation?
:)
1.limit the size of the map,default is 1000. can config by key failcapacity
2.retry period,default is 100.can config by key retries.
3.shutdown the timer when destroyed
The issues:
#2425