[Bug]: Receiver side race condition
Bug Report
context: https://github.com/sgl-project/sglang/pull/13231
cc: @alogfans
Before submitting...
- [x] Ensure you searched for relevant issues and read the [documentation]
@flying-x Thank you so much for the digging. I think we can discuss and arrange a fix here.
@flying-x So the fix scope should be inside tcp_transport, especially the ASIO callback logic. Try to check that if there are multiple slices for a single request.
Thank you @ShangmingCai and @alogfans.
I am thinking that the sender side can queue a readBody call after sending all slices and when the callback of the readBody is done, it then calls markSuccess(). On the receiving side, once all readBody calls are done (including cudaMemcpy calls), it will send an ACK msg (1 byte, with writeBody and then finish the request) so that readBody call from the sender side will be unblocked.
The sender side needs to have a timeout on the readBody, but other than that, there should be no new error handling.
Does the above sound OK?
This will definitely increase the TTFT, but I assume TCP fallback doesn't require strict SLO for TTFT.
As long as we can keep most changes in the mooncake part, this method seems reasonable to me.
In fact, I previously encountered a similar issue when testing with TCP. After the TE reports that the transfer has completed successfully, if you immediately check the data on the receiving side, there is a chance that the data has not been fully written yet.
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.