Skip to content

Commit

Permalink
Fix potential connection leak bug when closing NacosDataSource (#2962)
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaapo authored and LearningGp committed Dec 27, 2023
1 parent e2580a0 commit 44080bc
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ public String readSource() throws Exception {
public void close() {
if (configService != null) {
configService.removeListener(dataId, groupId, configListener);
try {
configService.shutDown();
} catch (Exception e) {
RecordLog.warn("[NacosDataSource] Error occurred when closing Nacos data source", e);
e.printStackTrace();
}
}
pool.shutdownNow();
}
Expand Down

0 comments on commit 44080bc

Please sign in to comment.