Skip to content

Commit

Permalink
input: apply back pressure if input threaded plugin is paused (#7847)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Lenar <[email protected]>
  • Loading branch information
danlenar authored Sep 4, 2023
1 parent 6578ccc commit 9cb07ca
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/flb_input_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,9 +1766,18 @@ void flb_input_chunk_ring_buffer_collector(struct flb_config *ctx, void *data)
ins = mk_list_entry(head, struct flb_input_instance, _head);
cr = NULL;

while ((ret = flb_ring_buffer_read(ins->rb,
(void *) &cr,
sizeof(cr))) == 0) {
while (1) {
if (flb_input_buf_paused(ins) == FLB_TRUE) {
break;
}

ret = flb_ring_buffer_read(ins->rb,
(void *) &cr,
sizeof(cr));
if (ret != 0) {
break;
}

if (cr) {
if (cr->tag) {
tag_len = flb_sds_len(cr->tag);
Expand Down

0 comments on commit 9cb07ca

Please sign in to comment.