You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/01/05 14:21:44 UTC

[GitHub] [lucene-solr] muse-dev[bot] commented on a change in pull request #2177: SOLR-15052: Per-replica states for reducing overseer bottlenecks (trunk)

muse-dev[bot] commented on a change in pull request #2177:
URL: https://github.com/apache/lucene-solr/pull/2177#discussion_r551961005



##########
File path: solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
##########
@@ -1219,17 +1225,28 @@ public void process(WatchedEvent event) {
             event, coll, liveNodes.size());
       }
 
-      refreshAndWatch();
+      refreshAndWatch(event.getType());
 
     }
+    public void refreshAndWatch() {
+      refreshAndWatch(null);

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Unprotected write. Non-private method `ZkStateReader$StateWatcher.refreshAndWatch()` indirectly writes to field `noggit.JSONParser.devNull.buf` outside of synchronization.
    Reporting because another access to the same memory occurs on a background thread, although this access may not.

##########
File path: solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
##########
@@ -1219,17 +1225,28 @@ public void process(WatchedEvent event) {
             event, coll, liveNodes.size());
       }
 
-      refreshAndWatch();
+      refreshAndWatch(event.getType());
 
     }
+    public void refreshAndWatch() {
+      refreshAndWatch(null);
+    }
 
     /**
      * Refresh collection state from ZK and leave a watch for future changes.
      * As a side effect, updates {@link #clusterState} and {@link #watchedCollectionStates}
      * with the results of the refresh.
      */
-    public void refreshAndWatch() {
+    public void refreshAndWatch(EventType eventType) {
       try {
+        if (eventType == null || eventType == EventType.NodeChildrenChanged) {
+          refreshAndWatchChildren();

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Unprotected write. Non-private method `ZkStateReader$StateWatcher.refreshAndWatch(...)` indirectly writes to field `noggit.JSONParser.devNull.buf` outside of synchronization.
    Reporting because this access may occur on a background thread.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org