-
Notifications
You must be signed in to change notification settings - Fork 120
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
Erroneous dropped datagrams #2214
Conversation
What happens when you enqueue a 5000 byte datagram in a 1500 byte MTU? |
Datagrams would block sending until:
I had toyed with making the |
This is a pretty significant change in behavior. Blocking queues is going to cause all sorts of issues and is why the default implementation is the way it is currently. If the head of the queue isn't able to be transmitted with the current MTU then it's unlikely to ever be transmitted. If you're wanting different behavior you're free to implement your own datagram provider. That's exactly why this functionality is a provider: the default semantics won't make everyone happy. |
Fair enough, we'll likely implement our own Sender then. I would argue that dropping the datagram silently without any warning is not what most would expect. I agree that the default semantics are never going to make everyone happy, however a small warning emitted or an Error bubbled up to the caller seems entirely reasonable and something that I think the vast majority of users would appreciate and would not change the current semantic behavior of the If you'd like to keep the current behavior as the default, that is understandable. However there's likely still a bug in the If you'd like, I can modify #2213 to better capture a warning/error as a proposed solution, plus a fix to the waker behavior. Additionally, if the following is true (which I agree it is):
Then users should not be able to |
Yes let's do that. Thanks! |
Done, closing PR. |
Resolved issues:
resolves #2213
Description of changes:
Refactors
datagram::Sender::on_transmit
to properly handle when datagrams do not fit into a packet. Additionally adds a test for the new implementation, and renames an old test since the name no longer makes sense, given the new implementation.Call-outs:
None
Testing:
New unit test
poll_send_datagram_large
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.