Skip to content

Commit dd8df1d

Browse files
committed
Fix ingest smux success ack race
1 parent c3358bc commit dd8df1d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

internal/ingestsmux/server.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ func (s *Server) handleStream(stream *smux.Stream) error {
172172
_ = stream.Close()
173173
return fmt.Errorf("write ingest smux ack: %w", err)
174174
}
175-
if err := stream.CloseWrite(); err != nil {
176-
_ = stream.Close()
177-
return fmt.Errorf("close ingest smux write side: %w", err)
178-
}
175+
// The client closes the stream after reading the ack. Closing the server
176+
// write side immediately can race smux stream cleanup against that read for
177+
// unknown-length bodies, where the client already half-closed its writer.
179178
return nil
180179
}
181180

0 commit comments

Comments
 (0)