Skip to content

Commit

Permalink
When override workQueue for the controller should shutdown the origin…
Browse files Browse the repository at this point in the history
…al queue incase thread leakage

Issue: #3738

Signed-off-by: yuzhipeng <zpyu@alauda.io>
  • Loading branch information
yuzp1996 committed Oct 13, 2024
1 parent 471ed26 commit 6041de7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public DefaultControllerBuilder withName(String controllerName) {
* @return the controller builder
*/
public DefaultControllerBuilder withWorkQueue(RateLimitingQueue<Request> workQueue) {
if (this.workQueue != null && !this.workQueue.isShuttingDown()){
this.workQueue.shutDown();
}
this.workQueue = workQueue;
return this;
}
Expand Down

0 comments on commit 6041de7

Please sign in to comment.