in_storage_backlog: always try to put chunk up, if it fails just continue
@@ -70,19 +70,14 @@ static int cb_queue_chunks(struct flb_input_instance *in,
mk_list_foreach_safe(head, tmp, &sb->backlog) {
sbc = mk_list_entry(head, struct sb_chunk, _head);
- if (cio_chunk_is_file(sbc->chunk) == CIO_TRUE &&
- cio_chunk_is_up(sbc->chunk) == CIO_FALSE) {
-
+ /*
+ * All chunks on this backlog are 'file' based, always try to set
+ * them up. It could fail due to max_chunks_up limits.
+ */
ret = cio_chunk_up(sbc->chunk);
if (ret == -1) {
- flb_error("[storage backlog] unregistering %s:%s",
- sbc->stream->name, sbc->chunk->name);
- cio_chunk_close(sbc->chunk, CIO_FALSE);
- mk_list_del(&sbc->_head);
- flb_free(sbc);
continue;
}
- }
/* get the number of bytes being used by the chunk */
size = cio_chunk_get_real_size(sbc->chunk);
@@ -151,7 +146,7 @@ static int sb_prepare_environment(struct flb_sb *sb)
cio = sb->cio;
mk_list_foreach(head, &cio->streams) {
stream = mk_list_entry(head, struct cio_stream, _head);
- mk_list_foreach(c_head, &stream->files) {
+ mk_list_foreach(c_head, &stream->chunks) {
chunk = mk_list_entry(c_head, struct cio_chunk, _head);
ret = sb_append_chunk(chunk, stream, sb);
if (ret == -1) {
