ChinmaySKulkarni commented on a change in pull request #771:
URL: https://github.com/apache/phoenix/pull/771#discussion_r417645810
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java
##########
@@ -441,6 +453,23 @@ private static Properties
filterKnownNonProperties(Properties info) {
return result.build();
}
+ public boolean isInternalConnection() {
+ return isInternalConnection;
+ }
+
+ /**
+ * This method, and *only* this method is thread safe
+ * @param connection
+ */
+ public void addChildConnection(PhoenixConnection connection) {
+ synchronized (this) {
Review comment:
Avoid synchronizing on `this`. Let's have a separate variable which we
synchronize on which only relates to the childConnections and use `@GuardedBy`
syntax to denote this. Today we don't have any other methods synchronized on
`this` inside PhoenixConnection, but if we do tomorrow, there will be
unnecessary contention
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]