databento-rs icon indicating copy to clipboard operation
databento-rs copied to clipboard

`HistoricalClient` may ignore truncated responses on unexpected EOF?

Open yongqli opened this issue 2 months ago • 1 comments

When a process crashes, its open TCP connections close cleanly with an FIN/EOF (not an RST) [1]. Protocols built on TCP typically include explicit end-of-response framing or delimiting so clients can distinguish a complete response from a truncated one.

From a cursory look at the source, it appears that HistoricalClient may not handle this properly? It seems to ignore unexpected EOFs, so truncated responses would not trigger any errors. This may cause data to be lost, if the client was requesting a range in chunks, and one of the chunks was actually truncated.

Expected behavior: HistoricalClient should detect and raise an error when an unexpected EOF occurs.

Actual behavior: Unexpected EOFs appear to be silently ignored?

[1] https://internals.rust-lang.org/t/tcpstream-always-terminates-connections-successfully-even-on-panic/15109

yongqli avatar Oct 20 '25 05:10 yongqli

Can you share some code where you're seeing this issue?

threecgreen avatar Oct 20 '25 13:10 threecgreen

closing for lack of details

threecgreen avatar Nov 19 '25 17:11 threecgreen