-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[22208] The SocketTransportDescriptor::min_send_buffer_size() method returns too large value when exceeded net.core.wmem_max #4684
Comments
Below is a possible patch.
|
Using the code snippet below, it turned out that the
|
Tentative fix in this branch |
In general, these changes solve the issue. But there are suggestions related to error handling logic:
Proposed changes: diff --git a/src/cpp/rtps/transport/asio_helpers.hpp b/src/cpp/rtps/transport/asio_helpers.hpp
index b57d23d36..6e7f6d604 100644
--- a/src/cpp/rtps/transport/asio_helpers.hpp
+++ b/src/cpp/rtps/transport/asio_helpers.hpp
@@ -70,9 +70,9 @@ struct asio_helpers
final_buffer_value = option.value();
continue;
}
- // Could not determine the actual value, but the option was set successfully.
- // Assume the option was set to the desired value.
- return true;
+ // Could not determine the actual value.
+ // The current buffer size is not defined.
+ return false;
}
final_buffer_value /= 2;
@@ -87,10 +87,13 @@ struct asio_helpers
// Last attempt was successful. Get the actual value set.
BufferOptionType option;
socket.get_option(option, ec);
- if (!ec)
+
+ if (ec || option.value() < static_cast<int32_t>(minimum_buffer_value))
{
- final_buffer_value = option.value();
+ return false;
}
+
+ final_buffer_value = option.value();
return true;
}
return false; |
@i-and I think you are right. Would you be so kind to open a PR with your last proposed changes? Well, actually I would do the last part different: // Perform a final attempt to set the minimum value
final_buffer_value = minimum_buffer_value;
int32_t value_to_set = static_cast<int32_t>(final_buffer_value);
socket.set_option(BufferOptionType(value_to_set), ec);
if (!ec)
{
// Last attempt was successful. Get the actual value set.
BufferOptionType option;
socket.get_option(option, ec);
if (!ec && (option.value() >= value_to_set))
{
final_buffer_value = option.value();
return true;
}
}
return false; |
Is there an already existing issue for this?
Expected behavior
The values
sendBufferSize
andreceiveBufferSize
from theSocketTransportDescriptor
adequately reflect the buffer sizes of the created UDP sockets.Current behavior
The values
sendBufferSize
andreceiveBufferSize
from theSocketTransportDescriptor
andSocketTransportDescriptor::min_send_buffer_size()
method return larger values than the actual size of the UDP socket buffers.Steps to reproduce
Using the fields
sendBufferSize
andreceiveBufferSize
from theSocketTransportDescriptor
, you must set a value greater than net.core.wmem_max or net.core.rmem_max.Fast DDS version/commit
v2.13.0
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
UDPv4
Additional context
No response
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: