[Libwebsockets] Tight loop 100% CPU with [SSL_connect WANT_... retrying]

Andrejs Hanins andrejs.hanins at ubnt.com
Mon Nov 23 12:46:17 CET 2015


	I'm getting 100% CPU load when LWS client in SSL mode is connecting to some TCP port which accepts connection at TCP level but doesn't respond to SSL "Client hello". It typically happens when server process is very busy or hanged (I test with kill -stop PID). LWS client log outputs lots of "SSL_connect WANT_... retrying" messages which seem to come without any delay, so causing 100% CPU. Also for each such message I get LWS_CALLBACK_CHANGE_MODE_POLL_FD callback with POLLIN + POLLOUT events set, however current events are already set for POLLIN and POLLOUT.

	Isn't 100% CPU load is something which should not happen in this situation? Any suggestions to avoid it? It is quite frustrating that clients which try to connect to busy servers eat 100% CPU.

	Thanks in advance!

BR, Andrey

More information about the Libwebsockets mailing list