Hi, Sorry, I made a mistake in last mail, if “vac_disconnect” called “unset_timeout” instead of “set_timeout", which would make client never ever connect to vpp. I found the correct solution and tested, in “vac_connect” function, it should call “timeout_in_progress=false” to unset the global variable which was set after “vac_disconnect” called. I will try gerrit. Thanks for reading.
> 在 2019年6月12日,上午1:17,Ole Troan <otr...@employees.org> 写道: > > Hi Jin, > > Thank you for the describtion. > Great if you can push your patch to gerrit and I will review and merge. > > Best regards, > Ole > >> On 4 Jun 2019, at 08:29, Jin Zhihua <zh....@catontechnology.com> wrote: >> >> Dear all: >> I am developing a vpp client built with govpp by using “AsyncConnect” >> function. The first time I run the client before or after vpp, everything is >> ok. After I restart vpp while keeping the client running, the CPU usage of >> the client becomes high to around 70%. >> I have found the problem and solved it. I didn’t find any Jira ticket >> entry, so I posted here and I hope the developers would solve it in next >> release. Thanks. >> >> I used “top -H” and gdb to find the high cpu usage thread which is >> “vac_timeout_thread_fn” in file “src/vpp-api/client/client.c”. The first >> time it blocked in “pthread_cond_wait”, which won’t take cpu. >> but in second time, it runs the loop all the time because >> “timeout_in_progress” becomes true and “read_timeout” is still zero, which >> make “pthread_cond_timedwait” always returns. >> >> I found the problem is in “vac_disconnect” , it calls “set_timeout(0)”, >> which will make the issue above happend. >> In fact, “vac_disconnect” should call “unset_timeout()” to make thread >> quit gracefully and keep the global variables connect. >> >> >> -=-=-=-=-=-=-=-=-=-=-=- >> Links: You receive all messages sent to this group. >> >> View/Reply Online (#13253): https://lists.fd.io/g/vpp-dev/message/13253 >> Mute This Topic: https://lists.fd.io/mt/32015501/675193 >> Group Owner: vpp-dev+ow...@lists.fd.io >> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [otr...@employees.org] >> -=-=-=-=-=-=-=-=-=-=-=- >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#13264): https://lists.fd.io/g/vpp-dev/message/13264 Mute This Topic: https://lists.fd.io/mt/32015501/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-