Skip to content

HistoricalClient may ignore truncated responses on unexpected EOF? #68

@yongqli

Description

@yongqli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions