BewareMyPower opened a new pull request, #16510:
URL: https://github.com/apache/pulsar/pull/16510
Fixes #16509
### Motivation
Since all producers and consumer of the same Client share the same
connection pool, if one failed, the following producer or consumer might
reuse the broken connection and failed with `ResultConnectError`. It
causes the flaky `testWrongListener` because the consumer and reader
would be created after the producer creation failed with
`ResultServiceNotReady`.
### Modifications
Recreate the `Client` for the subsequent creation of `Consumer` and
`Reader` so that new connection pools will be used for them.
There is also a potential bug that makes `Client::shutdown` wait for the
max timeout (3 seconds), this PR also applies the timeout for other
executors.
### Verifying this change
After this change, I've run the following command in my local env and it
never failed.
```bash
# rerun the testWrongListener for 20 times
./tests/main --gtest_filter='ClientTest.testWrongListener' --gtest_repeat=20
```
### Documentation
Check the box below or label this PR directly.
Need to update docs?
- [ ] `doc-required`
(Your PR needs to update docs and you will update later)
- [x] `doc-not-needed`
(Please explain why)
- [ ] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
--
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]