[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321052124
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 
 Review comment:
   actually, I guess in the code as it stands the prior assigment will actually 
allow us to return the prior work, but we haven't assigned the immutable copy 
anywhere so the next time this is called the return value will be mutable 
If the prior line is removed *then* we repeat the work unless this is changed 
too... 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321052124
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 
 Review comment:
   actually, I guess in the code as it stands the prior assigment will actually 
allow us to return the prior work, but we haven't assigned the immutable copy 
anywhere so the next time this is called the return value will be mutable 
If the prior line is removed *then* we repeat the work... 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321050856
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 }
   }
 }
-return this.apis;
+return syncedApis;
 
 Review comment:
   This probably didn't need too change. If the prev comment is fixed, this 
will return the mutable version 


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321050532
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 }
   }
 }
-return this.apis;
+return syncedApis;
 
 Review comment:
   And here we return the mutable collection???


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321050532
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 }
   }
 }
-return this.apis;
+return syncedApis;
 
 Review comment:
   And here we return the mutable collection???


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321050511
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -303,11 +306,11 @@ public String toString() {
 }
   });
 
-  this.apis = ImmutableList.copyOf(apis);
+  syncedApis = ImmutableList.copyOf(syncedApis);
 
 Review comment:
   Shouldn't this be assigning to this.apis so that we don't have to do this 
work and create a new list every time?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked locking bug is fixed.

2019-09-04 Thread GitBox
gus-asf commented on a change in pull request #838: SOLR-13705 Double-checked 
locking bug is fixed.
URL: https://github.com/apache/lucene-solr/pull/838#discussion_r321050422
 
 

 ##
 File path: 
solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java
 ##
 @@ -260,22 +260,25 @@ public String toString() {
 
   @Override
   public Collection getApis() {
-if (apis == null) {
+Collection syncedApis = apis;
+if (syncedApis == null) {
   synchronized (this) {
-if (apis == null) {
-  Collection apis = new ArrayList<>();
+syncedApis = apis;
+if (syncedApis == null) {
+  syncedApis = new ArrayList<>();
+  apis = syncedApis;
 
 Review comment:
   Is this correct? Doesn't this line assigning syncedApis to apis expose the 
partially configured empty list to the rest of the world as a non-immutable 
collection while the rest of this method executes (which was the original 
complaint)? I think without this line the patch is an improvement...(the 
existing code has this problem too).


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org