erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.4k stars 2.96k forks source link

httpc: stream_start on an already running stream #8618

Open sirihansen opened 4 months ago

sirihansen commented 4 months ago

Describe the bug This is more of a question than a bug report at this time. We are using httpc to implement an SSE stream client. So we call httpc:request /5 with options [{stream,self},{sync,false}], then we wait for {http, {RequestId, stream_start, Headers}}, and after that we expect stream content or stream end messages. But every now and then we get another stream_start message. This can happen several minutes after we set up the stream and have received the first stream_start with the same RequestId. So the question is, is this normal and something that can be ignored, or should it be investigated?

To Reproduce It happens every now and then both in our test- and prod environments, but I haven't (yet) found a way to reproduce it on demand.

Expected behavior I did expect only stream content or stream_end (or errors) after the first stream_start message.

Affected versions 26.2

Additional context

Whaileee commented 4 months ago

I will take a look at this one. I have a theory, but need to verify it before I say anything specific

Whaileee commented 3 weeks ago

@sirihansen Could you provide more insight on how the httpc stream is setup? What headers are used? Any detail that you feel could make a difference. Thanks in advance