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
inform the application about acknowledged and lost DATAGRAM frames #4273
Comments
@chungthuang @joliveirinha @tanghaowillow @nanokatze Is that something that would be interesting for your use cases? Any thoughts on the proposed API? |
yes. I believe it would be interesting to have this, even if just for the sake of having some custom "labelled" metrics on top of it. |
It's not immediately clear whether it would be useful for my particular use case, I'd need to experiment to say. Some things that pop up to me about the API are:
Beside these two, it would maybe make the API nicer if the user provided an |
Yes, you're right, thank you! I've correct the proposal.
Can you elaborate how this would be a deadlock? Obviously, the application must not block on these callbacks, or do any non-negligible amount of work, otherwise it would block quic-go's run loop.
No strong opinion either way. Two function parameters seem fine to me, and it means we don't have to come up with a name for another interface 😉 |
What I was saying is that initially I wasn't sure whether it would deadlock (having thought that the callback could be called from inside some critical section that is also entered whenever the user calls some API.) I inspected the source and it indeed doesn't seem to, so please disregard that. I left that comment in because I wasn't fully certain in correctness of my findings. |
It might be interesting to expose a notification to the application when a DATAGRAM frame is lost or acknowledged, similar to the
FrameHandler
interface. For example, we could change the method toSendDatagram(data []byte, onAcked, onLost func()) err error
. This would give the application some hint what happened to a particular datagram. It would also be really simple to implement, since we just need to pipe through theFrameHandler
callbacks to the user. We could then manually call theOnLost
callback when we discard a DATAGRAM frame in the corner case described in (3). Note however, that this is just a hint, since:* A packet might be declared lost even though it was actually received. This could happen if the ACK frame(s) for that packet are lost.
* Even if a packet was acknowledged, the DATAGRAM might not have been delivered to the application. All that the acknowledgment tells us is that the peer's QUIC stack received the packet, but depending on the implementation, delivery to the application might not be reliable.
Originally posted by @marten-seemann in #4145 (comment)
The text was updated successfully, but these errors were encountered: