jianliu commented on a change in pull request #11587:
URL: https://github.com/apache/shardingsphere/pull/11587#discussion_r680686033
##########
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:
connectionPostProcessors has memory visibility issues here,linkedList is
not thread-safe,if we don`t use CopyOnWriteArrayList, we can use
Collections.synchronizedList(new LinkedList<>()) instead.
Do you have any recommendations?
--
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]