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



##########
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:
       changed to internalProcessFunctionRequest




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