Skip to content

Commit 137f9f0

Browse files
cosmo0920edsiper
authored andcommitted
out_s3: Address comments
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 26b79eb commit 137f9f0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plugins/out_s3/s3.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ static int cb_s3_init(struct flb_output_instance *ins,
704704
return -1;
705705
}
706706
if (ctx->use_put_object == FLB_FALSE &&
707-
(ctx->compression == FLB_AWS_COMPRESS_ARROW ||
708-
ctx->compression == FLB_AWS_COMPRESS_PARQUET)) {
707+
(ret == FLB_AWS_COMPRESS_ARROW ||
708+
ret == FLB_AWS_COMPRESS_PARQUET)) {
709709
flb_plg_error(ctx->ins,
710710
"use_put_object must be enabled when Apache Arrow or Parquet is enabled");
711711
return -1;
@@ -1132,8 +1132,13 @@ static int upload_data(struct flb_s3 *ctx, struct s3_file *chunk,
11321132
ret = flb_aws_compression_compress(ctx->compression, body, body_size, &payload_buf, &payload_size);
11331133
if (ret == -1) {
11341134
flb_plg_error(ctx->ins, "Failed to compress data");
1135+
if (chunk != NULL) {
1136+
s3_store_file_unlock(chunk);
1137+
chunk->failures += 1;
1138+
}
11351139
return FLB_RETRY;
1136-
} else {
1140+
}
1141+
else {
11371142
preCompress_size = body_size;
11381143
body = (void *) payload_buf;
11391144
body_size = payload_size;

0 commit comments

Comments
 (0)