MrLolthe1st commented on PR #37970: URL: https://github.com/apache/arrow/pull/37970#issuecomment-1752149766
> Why do we need to care about `MessageReader`? This implementation re-creates `StreamDecoderImpl` instead of reusing existing `StreamDecoderImpl` (including `MessageReader`). Because when we got EOS in the middle of payload. Call stack when we've got EOS looks like that: Listener::OnEOS(..) StreamDecoderImpl::OnEOS() MessageDecoderImpl::OnEOS() <- that is old message decoder, that already is in EOS state. after exiting method above, we will return here. ... MessageDecoderImpl::Consume(...) MessageDecoder::Consume(...) StreamDecoderImpl::Consume(...) So, if we recreate StreamDecoderImpl in Listener::OnEOS(), after exiting Listener::OnEOS we're will 1. Return to old StreamDecoderImpl, that isn't exists. 2. Than return to old MessageDocederImpl, that isn't exists. But, if we're somehow save old message decoder, it is in state EOS and will ignore all messages, that left in payload, because of EOS state. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
