Skip to content

Commit

Permalink
cloudwatch_logs: enable synchronous scheduler and async networking on…
Browse files Browse the repository at this point in the history
… cloudwatch

Signed-off-by: Matthew Fala <[email protected]>
  • Loading branch information
matthewfala committed Nov 22, 2022
1 parent 4309ba3 commit 1a44001
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions plugins/out_cloudwatch_logs/cloudwatch_logs.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,6 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
goto error;
}

/*
* Remove async flag from upstream
* CW output runs in sync mode; because the CW API currently requires
* PutLogEvents requests to a log stream to be made serially
*/
upstream->flags &= ~(FLB_IO_ASYNC);

ctx->cw_client->upstream = upstream;
flb_output_upstream_set(upstream, ctx->ins);
ctx->cw_client->host = ctx->endpoint;
Expand Down Expand Up @@ -666,7 +659,12 @@ struct flb_output_plugin out_cloudwatch_logs_plugin = {
.cb_init = cb_cloudwatch_init,
.cb_flush = cb_cloudwatch_flush,
.cb_exit = cb_cloudwatch_exit,
.flags = 0,

/*
* Allow cloudwatch to use async network stack synchronously by opting into
* FLB_OUTPUT_SYNCHRONOUS synchronous task scheduler
*/
.flags = FLB_OUTPUT_SYNCHRONOUS,
.workers = 1,

/* Configuration */
Expand Down

0 comments on commit 1a44001

Please sign in to comment.