PXC-4167: Node crashes with Transport endpoint is not connected #270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://jira.percona.com/browse/PXC-4167
Problem:
PXC-4167 was solved by the upstream commit
930c016, where catching of possible exception thrown by assign_address() (which calls
socket::remote_endpoint() where the actual call is done).
However, after that fix, it was reported several times that the issue rarely, but still occurs and the server fails with the following error:
terminate called after throwing an instance of 'std::system_error' what(): remote_endpoint: Transport endpoint is not connected
Cause:
Deeper analysis of the code shows, that such an exception can be thrown only from basic_socket::remote_endpoint(). The above-mentioned fix didn't consider the call of this method which is done just after assign_address() wrapped in try ... catch block.
Solution:
Extend the upstream fix to catch the uncaught exception.