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

压力测试读取队列处理丢包 #36

Open
ZHANGHSING opened this issue Jun 1, 2019 · 3 comments
Open

压力测试读取队列处理丢包 #36

ZHANGHSING opened this issue Jun 1, 2019 · 3 comments

Comments

@ZHANGHSING
Copy link

if (FD_ISSET(c->pub_pipe[0], &readset))
{
MQTTMessage *message;
MQTTString topic = MQTTString_initializer;

        LOG_D("pub_sock FD_ISSET");

        len = read(c->pub_pipe[0], c->readbuf, c->readbuf_size);
         .......

同时往队列加入多个数包时,len将所有数据读取出来,却只处理了最前一条数据导致后面数据丢失

如:一个数据包长度为57,同时2包数据加入队列(环境:在MQTT任务处理其它任务时加入)
读取出来的len长度为114,这时只有一会发送一包数据到服务器

@Ackleys
Copy link

Ackleys commented Feb 6, 2020

我在压力测试的发现单片机会跑飞,12个小时之内就会跑飞,且没任何异常抛出,没加任何功能,直接用自带的DEMO,请问你有遇到这个问题吗?

@SmartFrogFromChina
Copy link

if (FD_ISSET(c->pub_pipe[0], &readset))
{
MQTTMessage *message;
MQTTString topic = MQTTString_initializer;

        LOG_D("pub_sock FD_ISSET");

        len = read(c->pub_pipe[0], c->readbuf, c->readbuf_size);
         .......

同时往队列加入多个数包时,len将所有数据读取出来,却只处理了最前一条数据导致后面数据丢失

如:一个数据包长度为57,同时2包数据加入队列(环境:在MQTT任务处理其它任务时加入)
读取出来的len长度为114,这时只有一会发送一包数据到服务器

确实有这种情况,我每5秒钟发布一个心跳包给服务器,然后不定期发布其他数据给服务器的时候就会发现,这两种数据有一种被丢弃了

@lizdDong
Copy link
Contributor

我也有遇到,同时publish多个必失败,而且即使配置为阻塞发送,源码中的pub_mutex好像也并没有起到该有的作用,原因是mutex被其它应用线程持有,却试图由paho_mqtt_thread线程释放,这在rt thread中是不支持的

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

4 participants