You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/12 16:26:16 UTC

[GitHub] [pulsar] srkukarni commented on a change in pull request #7509: Fix: Race condition in updateFunctionOnLeader

srkukarni commented on a change in pull request #7509:
URL: https://github.com/apache/pulsar/pull/7509#discussion_r453336440



##########
File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionMetaDataManager.java
##########
@@ -199,44 +203,49 @@ public synchronized boolean containsFunction(String tenant, String namespace, St
      * @throws IllegalStateException if we are not the leader
      * @throws IllegalArgumentException if the request is out of date.
      */
-    public synchronized void updateFunctionOnLeader(FunctionMetaData functionMetaData, boolean delete)
+    public void updateFunctionOnLeader(FunctionMetaData functionMetaData, boolean delete)

Review comment:
       Shouldn't this be at a higher layer? Like in the rest call handler. For regular commands we check if worker is ready. For this command we shuold check if we are leader and if leaderInit is done. Not sure if metadata mgr should get this logic




----------------------------------------------------------------
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