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

CPU goes to 100% when mqtt server is started with no network #479

Closed
ZhiweiLi opened this issue Jun 5, 2018 · 2 comments
Closed

CPU goes to 100% when mqtt server is started with no network #479

ZhiweiLi opened this issue Jun 5, 2018 · 2 comments

Comments

@ZhiweiLi
Copy link

ZhiweiLi commented Jun 5, 2018

CPU goes to 100% when mqtt server is started with no network
and it cannot recover when network comes back

when enabled log , i saw tremendous log printing repeately

19700101 150802.649 Could not find client corresponding to socket 6
19700101 150802.649 (2051) (1)> MQTTAsync_cycle:2814
19700101 150802.649 (2051) (2)> Socket_getReadySocket:217
19700101 150802.649 Return code 1 from read select
19700101 150802.649 (2051) (3)> Socket_continueWrites:776
19700101 150802.649 (2051) (3)< Socket_continueWrites:798 (0)
19700101 150802.649 Return code 1 from write select
19700101 150802.649 (2051) (3)> isReady:193
19700101 150802.649 (2051) (3)< isReady:198 (1)
19700101 150802.669 (2051) (2)< Socket_getReadySocket:283 (6)
19700101 150802.669 (2051) (2)> MQTTAsync_retry:2677
19700101 150802.669 (2051) (3)> MQTTProtocol_retry:629
19700101 150802.669 (2051) (3)< MQTTProtocol_retry:648
19700101 150802.669 (2051) (2)< MQTTAsync_retry:2687
19700101 150802.669 (2051) (1)< MQTTAsync_cycle:2946 (-1)
19700101 150802.669 Could not find client corresponding to socket 6

After checking the code, it seems that it is stucked in the infinite loop
in function MQTTAsync_receiveThread()
/* find client corresponding to socket /
if (ListFindItem(handles, &sock, clientSockCompare) == NULL)
{
Log(TRACE_MINIMUM, -1, "Could not find client corresponding to socket %d", sock);
/
Socket_close(sock); - removing socket in this case is not necessary (Bug 442400) */
continue;
}

my client version:
Trace Output
Product name: Paho Asynchronous MQTT C Client Library
Version: 1.1.0
Build level: 17:38--04-06-2018
OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017
OpenSSL flags: compiler: /usr/local/ARC/arcp1/uclibc/bin/arc-linux-uclibc-gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DDSO_DLFCN -DHAVE_DLFCN_H -I/home/zli/work/sdk
OpenSSL build timestamp: built on: reproducible build, date unspecified
OpenSSL platform: platform: linux-arc
OpenSSL directory: OPENSSLDIR: "/usr/lib/ssl"
/proc/version: Linux version 2.6.35.12 (zli@ddfeerd) (gcc version 4.2.3 (ARC_2.3)) #10 Mon Jun 4 19:38:20 CST 2018

@icraggs
Copy link
Contributor

icraggs commented Jun 5, 2018

Can you try the latest version 1.2.1? There have been a number of fixes in this area.

@ZhiweiLi
Copy link
Author

ZhiweiLi commented Jun 6, 2018

Hi, Icraggs,

Thanks a log for your prompt response
I have upgraded to 1.2.1 and issue resolved.
I will close this issue.

@ZhiweiLi ZhiweiLi closed this as completed Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants