Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++] Fix segmentation fault when creating socket failed (#14834)
### Motivation #14823 fixes the flaky `testConnectTimeout` but it's also a regression of #14587. Because when the fd limit is reached, the `connectionTimeoutTask_` won't be initialized with a non-null value. Calling `stop` method on it directly will cause segmentation fault. See https://github.com/apache/pulsar/blob/0fe921f32cefe7648ca428cd9861f9163c69767d/pulsar-client-cpp/lib/ClientConnection.cc#L178-L185 ### Modifications Add the null check for `connectionTimeoutTask_` in `ClientConnection::close`. (cherry picked from commit 54c368e)
- Loading branch information