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/05/02 10:54:18 UTC

[GitHub] [pulsar] rueian opened a new issue #6858: Python Pulsar Function Crash With customRuntimeOptions

rueian opened a new issue #6858:
URL: https://github.com/apache/pulsar/issues/6858


   **Describe the bug**
   
   If the python function is created with --custom-runtime-options, it will crash with `google.protobuf.json_format.ParseError: Message type "proto.FunctionDetails" has no field named "customRuntimeOptions".`
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Write a python pulsar function:
   ```python
   from pulsar import Function
   
   class RandomFunction(Function):
       def process(self, item, context):
           context.get_logger().info(context.get_message_id())
   ```
   
   2. Deploy with the command:
   
   ```
   bin/pulsar-admin functions update --py rand.py \
   --classname rand.RandomFunction \
   --inputs persistent://public/default/random \
   --custom-runtime-options '{"resourceRequirements":{"limits":{"memory":"64Mi"}'
   ```
   
   3. See error
   
   ```
   ▶ kubectl logs -f pf-public-default-randomfunction-e5521ea1-0
   "Downloaded successfully"
   shardId=0
   Traceback (most recent call last):
     File "/pulsar/instances/python-instance/python_instance_main.py", line 211, in <module>
       main()
     File "/pulsar/instances/python-instance/python_instance_main.py", line 98, in main
       json_format.Parse(args.function_details, function_details)
     File "/usr/local/lib/python2.7/dist-packages/google/protobuf/json_format.py", line 430, in Parse
       return ParseDict(js, message, ignore_unknown_fields, descriptor_pool)
     File "/usr/local/lib/python2.7/dist-packages/google/protobuf/json_format.py", line 450, in ParseDict
       parser.ConvertMessage(js_dict, message)
     File "/usr/local/lib/python2.7/dist-packages/google/protobuf/json_format.py", line 481, in ConvertMessage
       self._ConvertFieldValuePair(value, message)
     File "/usr/local/lib/python2.7/dist-packages/google/protobuf/json_format.py", line 592, in _ConvertFieldValuePair
       raise ParseError(str(e))
   google.protobuf.json_format.ParseError: Message type "proto.FunctionDetails" has no field named "customRuntimeOptions".
    Available Fields(except extensions): ['tenant', 'namespace', 'name', 'className', 'logTopic', 'processingGuarantees', 'userConfig', 'secretsMap', 'runtime', 'autoAck', 'parallelism', 'source', 'sink', 'resources', 'packageUrl', 'retryDetails', 'runtimeFlags', 'componentType']
   ```
   
   **Expected behavior**
   Message "proto.FunctionDetails" should accept "customRuntimeOptions".
   
   
   **Desktop (please complete the following information):**
    - Pulsar Docker Image pulsar-all 2.5.1
    - k8s helm
   


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



[GitHub] [pulsar] sijie commented on issue #6858: Python Pulsar Function Crash With customRuntimeOptions

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6858:
URL: https://github.com/apache/pulsar/issues/6858#issuecomment-624779890


   @tuteng can you cherry-pick the change to branch 2.5 for 2.5.2 release?


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



[GitHub] [pulsar] sijie commented on issue #6858: Python Pulsar Function Crash With customRuntimeOptions

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6858:
URL: https://github.com/apache/pulsar/issues/6858#issuecomment-624402872


   @tuteng I remembered that we fix the protobuf generation issue in 2.5.1. Can you take a look at why this issue still happens in 2.5.1?


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



[GitHub] [pulsar] tuteng commented on issue #6858: Python Pulsar Function Crash With customRuntimeOptions

Posted by GitBox <gi...@apache.org>.
tuteng commented on issue #6858:
URL: https://github.com/apache/pulsar/issues/6858#issuecomment-624412302


   I'm very sorry, this pr https://github.com/apache/pulsar/pull/6641 seems to have forgotten to be added to 2.5.1. @sijie @rueian 


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



[GitHub] [pulsar] sijie commented on issue #6858: Python Pulsar Function Crash With customRuntimeOptions

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6858:
URL: https://github.com/apache/pulsar/issues/6858#issuecomment-624998246


   @rueian #6641 will be cherry-picked into 2.5.2. So close this issue for now.


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