[24549] Remove stale tcp channels#6421
Open
cferreiragonz wants to merge 4 commits into
Open
Conversation
…lients Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>
Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>
Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>
1 task
Danipiza
requested changes
Jun 5, 2026
|
|
||
| // Wait for the server to finish the BindConnectionRequest handshake | ||
| auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(5); | ||
| while (server.get_channel_resources().empty() && |
Contributor
There was a problem hiding this comment.
Possible data race. We can use in MockTCPv4Transport.h
size_t get_channel_resources_size() const
{
std::lock_guard<std::mutex> lock(unbound_map_mutex_);
return unbound_channel_resources_.size();
}| std::this_thread::sleep_for(std::chrono::milliseconds(100)); | ||
| } | ||
| EXPECT_TRUE(server.get_channel_resources().empty()); | ||
| EXPECT_TRUE(server.get_unbound_channel_resources().empty()); |
Contributor
There was a problem hiding this comment.
Same here
size_t get_unbound_channel_resources_size() const
{
std::lock_guard<std::mutex> lock(unbound_map_mutex_);
return unbound_channel_resources_.size();
}Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR introduces logic to remove stale TCP ACCEPT type channels when the listening operation ends (Asio detects and closes the socket). We can only perform this action on ACCEPT type channels because the re-connection mechanism of the CONNECT type channels rely on detecting stale channels and try to re-establish the connection when data needs to be sent.
@Mergifyio backport 3.2.x 2.14.x
Contributor Checklist
versions.mdfile (if applicable).Reviewer Checklist