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



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
##########
@@ -392,24 +392,13 @@ public void deregisterFunction(final String tenant,
             throw new RestException(Status.NOT_FOUND, String.format("%s %s 
doesn't exist", ComponentTypeUtils.toString(componentType), componentName));
         }
 
-        CompletableFuture<RequestResult> completableFuture = 
functionMetaDataManager.deregisterFunction(tenant,
-                namespace, componentName);
-
-        RequestResult requestResult = null;
-        try {
-            requestResult = completableFuture.get();
-            if (!requestResult.isSuccess()) {
-                throw new RestException(Status.BAD_REQUEST, 
requestResult.getMessage());
-            }
-        } catch (ExecutionException e) {
-            log.error("Execution Exception while deregistering {} @ /{}/{}/{}",
-                    ComponentTypeUtils.toString(componentType), tenant, 
namespace, componentName, e);
-            throw new RestException(Status.INTERNAL_SERVER_ERROR, 
e.getCause().getMessage());
-        } catch (InterruptedException e) {
-            log.error("Interrupted Exception while deregistering {} @ 
/{}/{}/{}",
-                    ComponentTypeUtils.toString(componentType), tenant, 
namespace, componentName, e);
-            throw new RestException(Status.REQUEST_TIMEOUT, e.getMessage());
-        }
+        FunctionMetaData newVersionedMetaData = 
FunctionMetaDataUtils.generateUpdatedMetadata(functionMetaData, 
functionMetaData);
+        
processFunctionUpdate(newVersionedMetaData.getFunctionDetails().getTenant(),

Review comment:
       It is kind of confusing to be calling "processFunctionUpdate" in 
de-register routine since we also have a update function routine. Maybe rename 
the method to something else?  "processFunctionRequest"?




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


Reply via email to