BewareMyPower opened a new pull request #11557:
URL: https://github.com/apache/pulsar/pull/11557


   Fixes #11551 
   
   ### Motivation
   
   Currently there're some bugs of C++ client and 11 tests cannot pass, these 
tests can be divided into three groups. 
   
   1. Introduced from #10601 because it changed the behavior of the admin API 
to get partition metadata while the C++ implementation relies on the original 
behavior to create topics automatically. So any test that uses HTTP lookup will 
fail.
       - AuthPluginTest.testTlsDetectHttps
       - AuthPluginToken.testTokenWithHttpUrl
       - BasicEndToEndTest.testHandlerReconnectionLogic
       - BasicEndToEndTest.testV2TopicHttp
       - ClientDeduplicationTest.testProducerDeduplication
   2. Introduced from #11492, which adds padding characters but it will still 
add 4 `=`s even if the length can be divided by 4.
       - ProtobufNativeSchemaTest.testAutoCreateSchema
       - ProtobufNativeSchemaTest.testEndToEnd
       - ProtobufNativeSchemaTest.testSchemaJson
       - ProtobufNativeSchemaTest.testSchemaIncompatibility
   3. Introduced from #11029 and #11486 , the implementation will iterate more 
than once even there's only one valid resolved IP address.
       - ClientTest.testConnectTimeout
   
   In addition, there's an existed flaky test from very early time: 
ClientTest.testConnectTimeout
   
   Since the CI test of C++ client would never fail after #10309 (see #11549 
for detail), all PRs about C++ or Python client are not verified even if CI 
passed. Before fixing the broken C++ CI, we need to fix all existed bugs of C++ 
client.
   
   ### Modifications
   
   Corresponding to the above tests group, this PR adds following modifications:
   1. Add the `?checkAllowAutoCreation=true` URL suffix to allow HTTP lookup to 
create topics automatically.
   2. Do not add the padding characters if the Base64 string's length can be 
divided by 4.
   3. When iterating through a resolved IP list, increase the iterator first, 
then run the connection timer and try to connect the next IP.
   
   Regarding to the flaky `testConnectTimeout`, this PR adds a `client.close()` 
at the end of test and fix the `ClientImpl::close` implementation. Before this 
PR, if there're no producers or consumers in a client, the `close()` method 
wouldn't call `shutdown()` to close connection poll and executors. Only after 
the `Client` instance was destructed would the `shutdown()` method be called. 
In this case, this PR calls `handleClose` instead of invoking callback directly.
   
   I cannot reproduce the failure of `testConnectTimeout` when running 
`docker-tests.sh` in my local environment so this PR also changes the log level 
to debug in case it still failed in CI.
   
   ### Verifying this change
   
   We can only check the workflow output to verify this change.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to