Skip to content

Commit

Permalink
* MDF [mqtt_publich] avoid TSAN warning by finish App AIO sync.
Browse files Browse the repository at this point in the history
Signed-off-by: jaylin <jaylin@emqx.io>
  • Loading branch information
JaylinYu committed Aug 13, 2024
1 parent f5ada64 commit 7f1e93a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/supplemental/mqtt/mqtt_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ mqtt_close_unack_aio_cb(void *key, void *val)
nni_aio * aio = val;

if (aio) {
nni_aio_finish_error(aio, NNG_ECLOSED);
nni_aio_finish_sync(aio, 0, NNG_ECLOSED);
nni_msg_free(nni_aio_get_msg(aio));
nni_aio_set_msg(aio, NULL);
nni_aio_set_prov_data(aio, NULL);
Expand Down
7 changes: 5 additions & 2 deletions src/supplemental/mqtt/mqtt_public.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,11 +841,14 @@ nng_mqtt_client_send_cb(void* arg)
{
nng_mqtt_client *client = (nng_mqtt_client *) arg;
nng_aio * aio = client->send_aio;
nng_msg * msg = nng_aio_get_msg(aio);
nng_msg * tmsg = NULL;

nni_lmq * lmq = (nni_lmq *)client->msgq;

// in case of data conention while fini pipes
if (nng_aio_result(aio) == NNG_ECLOSED)
return;

nng_msg * msg = nng_aio_get_msg(aio);
if (msg == NULL || nng_aio_result(aio) != 0) {
client->cb(client, NULL, client->obj);
return;
Expand Down

0 comments on commit 7f1e93a

Please sign in to comment.