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:
[email protected]


Reply via email to