Closed Bronek closed 6 months ago
Attention: Patch coverage is 85.96491%
with 8 lines
in your changes are missing coverage. Please review.
Project coverage is 76.96%. Comparing base (
ea9b1e3
) to head (11f06fa
).
Files | Patch % | Lines |
---|---|---|
src/test/peerfinder/PeerFinder_test.cpp | 84.61% | 2 Missing and 6 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
If the fix is reverted, then the newly added test will result in the same crash as reported (in the Release build)
% ./rippled -u PeerFinder
ripple.PeerFinder.PeerFinder backoff 1
Logic error: PeerFinder::Logic::remove(): remote_endpoint missing from slots_
[1] 950283 segmentation fault ./rippled -u PeerFinder
This is ready to merge (but might want to delay merging after https://github.com/XRPLF/rippled/pull/4947 , so we have working Windows build as well)
The
test_duplicateOutIn()
test without the loop still causes theLogicError
if the fix is removed. Thetest_duplicateInOut()
without the loop does not fire theLogicError
, but it also did not fire theLogicError
with the loop either.
Yes, that's correct - new_outbound_slot
already did have the required check, so this test also increases test coverage outside of its immediate focus.
High Level Overview of Change
We do not currently enforce that incoming peer connection does not have
remote_endpoint
which is already used (either by incoming or outgoing connection), hence already stored inslots_
. If we happen to receive a connection from such a duplicateremote_endpoint
, it will eventually result in a crash (when disconnecting) or weird behaviour (when updating slot state), as a result of an apparently matchingremote_endpoint
inslots_
being used by a different connectionContext of Change
This came from troubleshooting a crash of our node in livenet, as reported in RIPD-1848
Type of Change
.gitignore
, formatting, dropping support for older tooling)Future Tasks
A different approach is also possible, where we do allow duplicate
remote_endpoint
and change the type ofslots_
accordingly. This would be a more intrusive change