jianliu commented on a change in pull request #11587:
URL: https://github.com/apache/shardingsphere/pull/11587#discussion_r680692721



##########
File path: 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
##########
@@ -81,7 +82,7 @@
     
     private final Collection<DatabaseCommunicationEngine> 
inUseDatabaseCommunicationEngines = Collections.newSetFromMap(new 
ConcurrentHashMap<>(64));
     
-    private final Collection<ConnectionPostProcessor> connectionPostProcessors 
= new LinkedList<>();
+    private final Collection<ConnectionPostProcessor> connectionPostProcessors 
= new CopyOnWriteArrayList<>();

Review comment:
       I took a look at the api doc,Collections.synchronizedList(new 
LinkedList()) need use synchronized (list) when Iterate over it.
   so if we want to keep use LinkedList,we need to synchronized 
(connectionPostProcessors /backendConnection) when add item or foreach it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to