Skip to content

Commit

Permalink
in_storage_backlog: if a chunk tag cannot be read, delete it
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Dec 30, 2023
1 parent 3a308f3 commit 97e2d20
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/in_storage_backlog/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ static int sb_append_chunk_to_segregated_backlog(struct cio_chunk *target_chu
struct sb_out_chunk *chunk;

chunk = sb_allocate_chunk(target_chunk, stream, target_chunk_size);

if (chunk == NULL) {
flb_errno();
return -1;
Expand Down Expand Up @@ -378,7 +377,16 @@ int sb_segregate_chunks(struct flb_config *config)
if (ret) {
/*
* if the chunk could not be segregated, just remove it from the
* queue and continue.
* queue, delete it and continue.
*/

/* If the tag cannot be read it cannot be routed, let's remove it */
if (ret == -2) {
cio_chunk_close(chunk, CIO_TRUE);
continue;
}

/*
*
* if content size is zero, it's safe to 'delete it'.
*/
Expand Down

0 comments on commit 97e2d20

Please sign in to comment.