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 2019/06/26 20:34:16 UTC

[GitHub] [pulsar] one70six opened a new issue #4610: pulsar-admin cli: pulsar functions api issues after changing function parallelism > 1

one70six opened a new issue #4610: pulsar-admin cli: pulsar functions api issues after changing function parallelism > 1
URL: https://github.com/apache/pulsar/issues/4610
 
 
   **Describe the bug**
   Commands such as the following work as long as your function has a parallelism of 1...
   `$PULSAR_HOME/bin/pulsar-admin functions getstatus --tenant public --namespace default --name exclamation`
   
   The results on the functions worker logs show a good return of:
   `"GET /admin/v3/functions/public/default/exclamation/status HTTP/1.1" 200 354 "-" "Pulsar-Java-v2.3.2" 14`
   
   `{
     "numInstances" : 1,
     "numRunning" : 1,
     "instances" : [ {
       "instanceId" : 0,
       "status" : {
         "running" : true,
         "error" : "",
         "numRestarts" : 0,
         "numReceived" : 0,
         "numSuccessfullyProcessed" : 0,
         "numUserExceptions" : 0,
         "latestUserExceptions" : [ ],
         "numSystemExceptions" : 0,
         "latestSystemExceptions" : [ ],
         "averageLatency" : 0.0,
         "lastInvocationTime" : 0,
         "workerId" : "localhost-6750"
       }
     } ]
   }
   `
   
   Changing the parallelism to >1 results in a bad return and the following output in the logs:
   `"GET /admin/v3/functions/public/default/exclamation/0/status HTTP/1.1" 500 110 "-" "Pulsar-Java-v2.3.2" 57`
   
   `org.apache.pulsar.client.admin.PulsarAdminException$NotAuthorizedException: HTTP 401 Unauthorized
   Reason: HTTP 500 Internal Server Error`
   
   It looks like the API is not able to pickup the numbers that are being appended to the URL when you add the parallelism, i.e.
   
   `GET /admin/v3/functions/public/default/exclamation/0/status`
   `GET /admin/v3/functions/public/default/exclamation/1/status`
   `GET /admin/v3/functions/public/default/exclamation/2/status`
   
   **To Reproduce**
   1. Create the exclamation function:
   `$PULSAR_HOME/bin/pulsar-admin \
   functions create \
     --jar examples/api-examples.jar \
     --classname org.apache.pulsar.functions.api.examples.ExclamationFunction \
     --inputs persistent://public/default/exclamation-input \
     --output persistent://public/default/exclamation-output \
     --name exclamation`
   2. Run the following to see good output
   `$PULSAR_HOME/bin/pulsar-admin functions getstatus --tenant public --namespace default --name exclamation`
   3. Change the parallelism to >1
   `$PULSAR_HOME/bin/pulsar-admin \
   functions update \
     --jar examples/api-examples.jar \
     --classname org.apache.pulsar.functions.api.examples.ExclamationFunction \
     --inputs persistent://public/default/exclamation-input \
     --output persistent://public/default/exclamation-output \
     --tenant public \
     --namespace default \
     --name exclamation \
     --parallelism 1 \`
   4. Rerun the command from step 2
   ``$PULSAR_HOME/bin/pulsar-admin functions getstatus --tenant public --namespace default --name exclamation`
   
   **Expected behavior**
   Should respond with a 200 and a result
   

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


With regards,
Apache Git Services