[Bug] Fix Bug that fe's connection which is timed out can't be released #4774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#4773
Thread [Connect-Scheduler-Check-Timer] will stop due to failing to iterate the connectionMap , because other threads will modify the connectionMap at the same time.
Fe's connection whic is timed out can't be released because of thread [Connect-Scheduler-Check-Timer] not working.
Exception
[fe.out]
INFO: Use Simple share channel pool to create protobuf RPC proxy with interface interface org.apache.doris.rpc.PBackendService
Exception in thread "ConnectScheduler Check Timer" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
at java.util.HashMap$ValueIterator.next(HashMap.java:1474)
at org.apache.doris.qe.ConnectScheduler$TimeoutChecker.run(ConnectScheduler.java:89)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)