Skip to content

Commit

Permalink
fixes #1673 High CPU usage with TLS
Browse files Browse the repository at this point in the history
The aio for connections was meant to have an infinite sleep (no
timeout), but was getting an initial value of zero, so we were spinning
on accept.
  • Loading branch information
gdamore committed Dec 16, 2023
1 parent 5750ca1 commit cc58517
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/supplemental/tls/tls_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ tls_alloc(tls_conn **conn_p, nng_tls_config *cfg, nng_aio *user_aio)
nni_aio_list_init(&conn->send_queue);
nni_aio_list_init(&conn->recv_queue);
nni_mtx_init(&conn->lock);
nni_aio_set_timeout(&conn->conn_aio, NNG_DURATION_INFINITE);
nni_aio_set_timeout(&conn->tcp_send, NNG_DURATION_INFINITE);
nni_aio_set_timeout(&conn->tcp_recv, NNG_DURATION_INFINITE);

Expand Down

0 comments on commit cc58517

Please sign in to comment.