[Bug] Because of thread-safety problem , replace connectionMap with concurrentMap from hashMap. (#4774)
Thread [Connect-Scheduler-Check-Timer] fail to iterate the connectionMap , because other threads will modify the connectionMap at the same time. Fe's connection which is timed out can't be released because of thread [Connect-Scheduler-Check-Timer] not working.
This commit is contained in:
@ -46,7 +46,7 @@ public class ConnectScheduler {
|
||||
private int maxConnections;
|
||||
private int numberConnection;
|
||||
private AtomicInteger nextConnectionId;
|
||||
private Map<Long, ConnectContext> connectionMap = Maps.newHashMap();
|
||||
private Map<Long, ConnectContext> connectionMap = Maps.newConcurrentMap();
|
||||
private Map<String, AtomicInteger> connByUser = Maps.newHashMap();
|
||||
private ExecutorService executor = ThreadPoolManager.newDaemonCacheThreadPool(Config.max_connection_scheduler_threads_num, "connect-scheduler-pool", true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user