Skip to content

Commit 97e2d20

Browse files
committed
in_storage_backlog: if a chunk tag cannot be read, delete it
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 3a308f3 commit 97e2d20

File tree

1 file changed

+10
-2
lines changed
  • plugins/in_storage_backlog

1 file changed

+10
-2
lines changed

plugins/in_storage_backlog/sb.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ static int sb_append_chunk_to_segregated_backlog(struct cio_chunk *target_chu
256256
struct sb_out_chunk *chunk;
257257

258258
chunk = sb_allocate_chunk(target_chunk, stream, target_chunk_size);
259-
260259
if (chunk == NULL) {
261260
flb_errno();
262261
return -1;
@@ -378,7 +377,16 @@ int sb_segregate_chunks(struct flb_config *config)
378377
if (ret) {
379378
/*
380379
* if the chunk could not be segregated, just remove it from the
381-
* queue and continue.
380+
* queue, delete it and continue.
381+
*/
382+
383+
/* If the tag cannot be read it cannot be routed, let's remove it */
384+
if (ret == -2) {
385+
cio_chunk_close(chunk, CIO_TRUE);
386+
continue;
387+
}
388+
389+
/*
382390
*
383391
* if content size is zero, it's safe to 'delete it'.
384392
*/

0 commit comments

Comments
 (0)