You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "KKcorps (via GitHub)" <gi...@apache.org> on 2023/02/09 05:03:38 UTC

[GitHub] [pinot] KKcorps commented on a diff in pull request #10251: Avoid upsert metadata access after the manager is closed

KKcorps commented on code in PR #10251:
URL: https://github.com/apache/pinot/pull/10251#discussion_r1100984339


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -305,10 +382,48 @@ protected void handleOutOfOrderEvent(Object currentComparisonValue, Object recor
     }
   }
 
+  protected void startOperation() {
+    _numPendingOperations.getAndIncrement();
+  }
+
+  protected void finishOperation() {
+    if (_numPendingOperations.decrementAndGet() == 0) {
+      synchronized (_numPendingOperations) {
+        _numPendingOperations.notifyAll();
+      }
+    }
+  }
+
+  @Override
+  public void stop() {
+    _stopped = true;
+    int numPendingOperations = _numPendingOperations.decrementAndGet();

Review Comment:
   It should be just `_numPendingOperations.get()` right? No need to decrement here.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org