Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input: disable coroutines for custom events and input callbacks that do not support coroutines. #9338

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/flb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ int flb_io_net_connect(struct flb_connection *connection,
int ret;
int async = FLB_FALSE;
flb_sockfd_t fd = -1;
int flags = flb_connection_get_flags(connection);
// struct flb_upstream *u = u_conn->u;

if (connection->fd > 0) {
Expand All @@ -119,7 +120,7 @@ int flb_io_net_connect(struct flb_connection *connection,
}

/* Check which connection mode must be done */
if (coro) {
if (coro && (flags & FLB_IO_ASYNC)) {
async = flb_upstream_is_async(connection->upstream);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/tls/flb_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ int flb_tls_session_create(struct flb_tls *tls,
* In the other case for an async socket 'th' is NOT NULL so the code
* is under a coroutine context and it can yield.
*/
if (co == NULL) {
if (co == NULL || !flb_upstream_is_async(connection->upstream)) {
flb_trace("[io_tls] server handshake connection #%i in process to %s",
connection->fd,
flb_connection_get_remote_address(connection));
Expand Down
Loading