Syphixs edited a comment on issue #9906:
URL: https://github.com/apache/pulsar/issues/9906#issuecomment-799224333


   You are correct I just have tested it on my mac and no problems there though 
I use the exact same libraries? boost 1.75 and pulsar client 2.8 ( 
84cfb3affa1ce5bc1db29baab5498205049019dd ). I also tried the backtrace with 
your suggestion , thanks for that. 
   
   
![out3](https://user-images.githubusercontent.com/33832024/111122944-0a8fea80-856f-11eb-91f9-6a90b3db9555.png)
    
   First output with cv2 import first. Hangs again at second imread
   Second output with pulsar import first. Error at creating producer.
   
   I have now tested it on 3 different ubuntu machines (19.10, 20.04. and 
20.10) and with boost 1.75 built from source or 1.71 with apt package manager 
and  opencv-python or opencv-python-headless ( version 4.4.0.40 till 4.5.1.48 ) 
and not a single combination works. I have also simplified the code that just 
cv2,pulsar and json have to be imported. Same errors occur
   
   `
   #!/usr/bin/env python3
   import cv2
   import pulsar
   import json
   
   
   def main():
       client = {}
       client["audience"] = "pulsar_service"
       client["issuer_url"] = "https://example.com/auth/realms/test_company";
       client["client_id"] = "pulsar-coco.detection.images"
       client["client_secret"] = "secret"
       client["grant_type"] = "client_credentials"
   
       temp_client = pulsar.Client(
           "pulsar+ssl://127.0.0.1:6651",
           use_tls=True,
           tls_trust_certs_file_path="./pulsar-test/ca.crt",
           authentication=pulsar.AuthenticationOauth2(json.dumps(client)),
       )
       test_topic = "persistent://ml/test_company/test"
       print(f"Testing client {client} in Realm on topic {test_topic}")
       test_producer = temp_client.create_producer(
           topic=test_topic, send_timeout_millis=5000
       )
       img_list = [
           "./pulsar-test/images/8375743808_a43f504e44_b.jpg",
           "./pulsar-test/images/8886531759_033e06ea68_b.jpg",
       ]
       for x in range(len(img_list)):
           print(f"{x} - Image")
           rnd_img = cv2.imread(img_list[x])
           print("after imread")
           _, image_np_array = cv2.imencode(".jpg", rnd_img)
           print("after imencode")
           image_byte_array = image_np_array.tobytes()
           print("after tobytes")
           # img_h, img_w, channels = rnd_img.shape
           # send to pulsar producer here...
   
   
   if __name__ == "__main__":
       main()
   `
   Any advice on further debugging would be highly appreciated! thanks
   


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