Fix: Improve Edge session cleanup to prevent resource leaks In unstable network environments, Edge devices may frequently disconnect and reconnect. The previous session cleanup logic could fail to stop the Kafka consumer, creating a 'zombie consumer'. This commit introduces a multi-layered defense: 1. Proactively evicts stale members from the Kafka consumer group upon new connection to ensure immediate functionality. 2. Adds a background task to persistently try and clean up session objects that failed to destroy, preventing memory/thread leaks.

This commit is contained in:
陈旭 2025-08-10 11:42:47 +08:00
parent e30adf0447
commit 4523efbcdd

View File

@ -219,6 +219,9 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
if (executorService != null) { if (executorService != null) {
executorService.shutdownNow(); executorService.shutdownNow();
} }
if(zombieSessionsExecutorService != null){
zombieSessionsExecutorService.shutdownNow();
}
} }
@Override @Override