sbourkeostk opened a new issue #6171: Python Functions broken by logging change
URL: https://github.com/apache/pulsar/issues/6171
 
 
   **Describe the bug**
   Native logging was added to the Python client in #6113 with a change to the 
constructor args. This change is not accommodated in the Python Function 
handling. python_instance_main uses the old args order causing the args to get 
misinterpreted.
   The new pulsar.Client constructor is:
   ```
   def __init__(self, service_url,
                    authentication=None,
                    operation_timeout_seconds=30,
                    io_threads=1,
                    message_listener_threads=1,
                    concurrent_lookup_requests=50000,
                    log_conf_file_path=None,
                    logger=None,
                    use_tls=False,
                    tls_trust_certs_file_path=None,
                    tls_allow_insecure_connection=False,
                    tls_validate_hostname=False,
                    ):
   ```
   pulsar-functions-instance python_instance_main calls:
   ```
   pulsar_client = pulsar.Client(args.pulsar_serviceurl, authentication, 30, 1, 
1, 50000, None, use_tls, tls_trust_cert_path, tls_allow_insecure_connection)
   ```
   causing the args from `use_tls` onwards to be off by one.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Setup a Python Function
   
   **Expected behavior**
   Function should run but instead it fails.
   
   **Screenshots**
   ```
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: Traceback (most recent call 
last):
   [2020-01-29 15:07:13 +0000] [ERROR] log.py:   File 
"/Users/sbourke/sw/src/pulsar-2020.01.29/pulsar-functions/instance/target/python-instance/python_instance_main.py",
 line 211, in <module>
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: main()
   [2020-01-29 15:07:13 +0000] [ERROR] log.py:   File 
"/Users/sbourke/sw/src/pulsar-2020.01.29/pulsar-functions/instance/target/python-instance/python_instance_main.py",
 line 161, in main
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: pulsar_client = 
pulsar.Client(args.pulsar_serviceurl, authentication, 30, 1, 1, 50000, None, 
use_tls, tls_trust_cert_path, tls_allow_insecure_connection)
   [2020-01-29 15:07:13 +0000] [ERROR] log.py:   File 
"/Users/sbourke/sw/src/pulsar-2020.01.29/pulsar-functions/instance/target/python-instance/pulsar/__init__.py",
 line 397, in __init__
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: 
_check_type_or_none(logging.Logger, logger, 'logger')
   [2020-01-29 15:07:13 +0000] [ERROR] log.py:   File 
"/Users/sbourke/sw/src/pulsar-2020.01.29/pulsar-functions/instance/target/python-instance/pulsar/__init__.py",
 line 1177, in _check_type_or_none
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: % (name, var_type.__name__))
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: ValueError
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: :
   [2020-01-29 15:07:13 +0000] [ERROR] log.py: Argument logger is expected to 
be either None or of type 'Logger'
   ```

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


With regards,
Apache Git Services

Reply via email to