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 committed Jan 5, 2023
1 parent f872864 commit a63fea3
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 a63fea3

Please sign in to comment.