-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backport v3.8.x): backport PR#395: retry_task_map: fix mem leak w…
…hen network is totally cut off (#436) * fix: retry_task_map: fix mem leak when network is totally cut off (#395) Previously, when handling failed task, the retry_task_map first releases the semaphore, and then reschedules the failed task directly without acquire the semaphore again. This results in the concurrent tasks semaphore being escaped when there are a lot of failed tasks. This is especially critical when the network is totally cut off, the failed tasks are pilling up and new tasks are still being scheduled, resulting in memory leaks. This PR fixes the above problem by fixing the task_done_cb, now when handling and re-scheduling the failed tasks, the semaphore will be kept. semaphore will only be released when the task is done successfully, or the thread-pool shutdowns. Other refinements to the retry_task_map includes: 1. watchdog: when watchdog func failed, watchdog thread will try to drain the pending workitem queue. 2. fut_gen: when thread-pool shutdowns, drain the finished futures queue. 3. dispatcher: directly exits when thread-pool shutdowns. 4. watchdog: refine the watchdog thread implementation.
- Loading branch information
1 parent
1a9329a
commit 8dbdfb2
Showing
3 changed files
with
125 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
- v* | ||
push: | ||
branches: | ||
- main | ||
- v* | ||
paths: | ||
- "src/**" | ||
- "tests/**" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8dbdfb2
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.
Coverage Report