-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the handler instance is expired when the connection is established (
#323) ### Motivation We observed some logs that showed the handler instance is expired when the connection is established after a reconnection: ``` HandlerBase Weak reference is not valid anymore ``` https://github.com/apache/pulsar-client-cpp/blob/b35ae1aa4b9834886c0889635de81834f9b2f774/lib/HandlerBase.cc#L92 ### Modifications Pass a `shared_ptr` instead of a `weak_ptr` in `HandlerBase::grabCnx` to ensure the `connectionOpened` or `connectionFailed` callback is called if `ClientImpl::getConnection` is called. We only need to pass a `weak_ptr` in `scheduleReconnection` to skip the reconnection if the handler is expired.
- Loading branch information
1 parent
b35ae1a
commit af45a54
Showing
5 changed files
with
28 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters