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 2021/01/27 22:32:39 UTC

[GitHub] [pulsar] jerrypeng commented on a change in pull request #9348: Make admin operations on Statestore non blocking

jerrypeng commented on a change in pull request #9348:
URL: https://github.com/apache/pulsar/pull/9348#discussion_r565683659



##########
File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
##########
@@ -362,19 +382,8 @@ public void deregisterFunction(final String tenant,
             log.error("{}/{}/{} Failed to authorize [{}]", tenant, namespace, componentName, e);
             throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
         }
-        // delete state table
-        if (null != worker().getStateStoreAdminClient()) {
-            final String tableNs = getStateNamespace(tenant, namespace);
-            final String tableName = componentName;
-            try {
-                FutureUtils.result(worker().getStateStoreAdminClient().deleteStream(tableNs, tableName));
-            } catch (NamespaceNotFoundException | StreamNotFoundException e) {
-                // ignored if the state table doesn't exist
-            } catch (Exception e) {
-                log.error("{}/{}/{} Failed to delete state table: {}", tenant, namespace, componentName, e.getMessage());
-                throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
-            }
-        }
+
+        deleteStatestoreTableAsync(getStateNamespace(tenant, namespace), componentName);

Review comment:
       Since all clean up operations are best effort, lets move deleteStatestoreTableAsync  after internalProcessFunctionRequest in deregisterFunction.  
   
   Also we don't want to delete the state table before we actually are sure we deleted the function




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