Skip to content

Commit 7bd1fb7

Browse files
committed
in_emitter: use peek/seek to leave faulty bufferes queued.
Signed-off-by: Phillip Adair Stewart Whelan <phillip.whelan@chronosphere.io>
1 parent 6c34428 commit 7bd1fb7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/in_emitter/emitter.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,16 @@ static int in_emitter_ingest_ring_buffer(struct flb_input_instance *in,
228228
(void) in;
229229

230230

231-
while ((ret = flb_ring_buffer_read(ctx->msgs, (void *)&ec,
231+
while ((ret = flb_ring_buffer_peek(ctx->msgs, 0, (void *)&ec,
232232
sizeof(struct em_chunk))) == 0) {
233233
ret = flb_input_log_append(in,
234234
ec.tag, flb_sds_len(ec.tag),
235235
ec.mp_sbuf.data,
236236
ec.mp_sbuf.size);
237+
if (ret < 0) {
238+
return ret;
239+
}
240+
flb_ring_buffer_skip(ctx->msgs, sizeof(struct em_chunk));
237241
flb_sds_destroy(ec.tag);
238242
msgpack_sbuffer_destroy(&ec.mp_sbuf);
239243
}

0 commit comments

Comments
 (0)