Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
When a microservice instance is going to exit, the SCBEngine will block the exit procedure, waiting for all of the invocations in processing status get finished. And in the method SCBEngine#validAllInvocationFinished, the unfinished invocations counter is checked. After waiting for a period of time, if there are still unfinished invocations, the SCBEngine should print error log to warn users about those invocations and exit the process forcely.
However, currently in the method SCBEngine#validAllInvocationFinished only the error log is printed, but no exit operation is done, leaving the exit procedure still blocked.
You can find the code segment to be fixed like below in the class SCBEngine:
private void validAllInvocationFinished() throws InterruptedException { long start = System.currentTimeMillis(); while (true) { long remaining = invocationStartedCounter.get() - invocationFinishedCounter.get(); if (remaining == 0) { return; } if (System.currentTimeMillis() - start > TimeUnit.SECONDS.toMillis(30)) { LOGGER.error("wait for all requests timeout, abandon waiting, remaining requests: {}.", remaining); // since the waiting logic is timed out, should return to exit here } TimeUnit.SECONDS.sleep(1); } }
Attachments
Issue Links
- is duplicated by
-
SCB-1601 Abandon waiting 30 seconds after waiting request timeout.
- Resolved