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 2022/06/17 15:34:34 UTC

[GitHub] [pulsar] BewareMyPower commented on issue #15976: [Python] Flaky-test: test_listener_name_client

BewareMyPower commented on issue #15976:
URL: https://github.com/apache/pulsar/issues/15976#issuecomment-1158997785

   It's easy to reproduce it locally. It's a bug when processing a partitioned topic. Because `test_listener_name_client` reuses a partitioned topic created by `test_get_partitioned_topic_name`.
   
   We can reproduce it by creating a partitioned topic in advance:
   
   ```bash
   ./bin/pulsar-admin topics create-partitioned-topic partitioned_topic_name_test -p 3
   ```
   
   Then, run the following Python script:
   
   ```python
   from pulsar import Client
   import pulsar
   
   client = Client('pulsar://localhost:6650', listener_name='test')
   try:
       producer = client.create_producer("persistent://public/default/partitioned_topic_name_test")
   except pulsar.PulsarException as e:
       print(e)
   
   client.close()
   ```
   
   There is a high chance that it failed with `AlreadyClosed`:
   
   ```
   2022-06-17 23:31:22.111 INFO  [0x111691600] ClientConnection:189 | [<none> -> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2022-06-17 23:31:22.111 INFO  [0x111691600] ConnectionPool:96 | Created connection for pulsar://localhost:6650
   2022-06-17 23:31:22.113 INFO  [0x700001194000] ClientConnection:375 | [127.0.0.1:62177 -> 127.0.0.1:6650] Connected to broker
   2022-06-17 23:31:22.115 INFO  [0x700001194000] HandlerBase:64 | [persistent://public/default/partitioned_topic_name_test-partition-0, ] Getting connection from pool
   2022-06-17 23:31:22.115 INFO  [0x700001194000] HandlerBase:64 | [persistent://public/default/partitioned_topic_name_test-partition-1, ] Getting connection from pool
   2022-06-17 23:31:22.115 INFO  [0x700001194000] HandlerBase:64 | [persistent://public/default/partitioned_topic_name_test-partition-2, ] Getting connection from pool
   2022-06-17 23:31:22.116 ERROR [0x700001194000] ClientConnection:1001 | [127.0.0.1:62177 -> 127.0.0.1:6650] Failed lookup req_id: 2 error: ServiceUnitNotReady msg: org.apache.pulsar.broker.PulsarServerException: the broker do not have test listener
   2022-06-17 23:31:22.116 ERROR [0x700001194000] PartitionedProducerImpl:150 | Unable to create Producer for partition - 0 Error - ServiceUnitNotReady
   2022-06-17 23:31:22.116 ERROR [0x700001194000] ClientConnection:597 | [127.0.0.1:62177 -> 127.0.0.1:6650] Read operation failed: Bad file descriptor
   Pulsar error: ServiceUnitNotReady
   2022-06-17 23:31:22.116 INFO  [0x700001194000] ClientConnection:1560 | [127.0.0.1:62177 -> 127.0.0.1:6650] Connection closed
   2022-06-17 23:31:22.116 INFO  [0x111691600] ClientImpl:500 | Closing Pulsar client with 1 producers and 0 consumers
   2022-06-17 23:31:22.116 ERROR [0x700001194000] PartitionedProducerImpl:289 | Closing the producer failed for partition - 0
   2022-06-17 23:31:22.116 ERROR [0x111691600] PartitionedProducerImpl:289 | Closing the producer failed for partition - 1
   2022-06-17 23:31:22.116 INFO  [0x700001194000] ProducerImpl:665 | [persistent://public/default/partitioned_topic_name_test-partition-2, ] Closing producer for topic persistent://public/default/partitioned_topic_name_test-partition-2
   2022-06-17 23:31:22.116 INFO  [0x111691600] ProducerImpl:630 | Producer - [persistent://public/default/partitioned_topic_name_test-partition-2, ] , [batching  = off]
   2022-06-17 23:31:22.116 INFO  [0x111691600] ProducerImpl:630 | Producer - [persistent://public/default/partitioned_topic_name_test-partition-1, ] , [batching  = off]
   2022-06-17 23:31:22.116 INFO  [0x111691600] ProducerImpl:630 | Producer - [persistent://public/default/partitioned_topic_name_test-partition-0, ] , [batching  = off]
   2022-06-17 23:31:22.117 INFO  [0x111691600] ClientConnection:263 | [127.0.0.1:62177 -> 127.0.0.1:6650] Destroyed connection
   Traceback (most recent call last):
     File "/Users/xuyunze/github.com/BewareMyPower/pulsar/pulsar-client-cpp/python/1.py", line 10, in <module>
       client.close()
     File "/Users/xuyunze/github.com/BewareMyPower/pulsar/pulsar-client-cpp/python/pulsar/__init__.py", line 890, in close
       self._client.close()
   _pulsar.AlreadyClosed: Pulsar error: AlreadyClosed
   ```


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org