When sending multiple metric-family samples in one stream the current implementation only decodes the first of those messages, all other ones are lost. This is the case since #567 which switches to directly using the protodelim package. However, in the process or copying the code, the initialization of the reader moved to the Decode() function and as such, the buffered reader continues somewhere in the actual data-stream (usually at the end) leading to an EOF on the next Decode() call.
The malfunction is present since release v0.46.0.
This PR moves the initialization out of Decode() into the initialization of the decoder preventing the described issue. Furthermore, we add a unit-test including a multi-message data-sample verifying the issue is fixed.
When sending multiple metric-family samples in one stream the current implementation only decodes the first of those messages, all other ones are lost. This is the case since #567 which switches to directly using the
protodelim
package. However, in the process or copying the code, the initialization of thereader
moved to theDecode()
function and as such, the buffered reader continues somewhere in the actual data-stream (usually at the end) leading to anEOF
on the nextDecode()
call.The malfunction is present since release v0.46.0.
This PR moves the initialization out of
Decode()
into the initialization of the decoder preventing the described issue. Furthermore, we add a unit-test including a multi-message data-sample verifying the issue is fixed.