mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

qos 1 messages not delivered for sleeping clients in current version of fixes branch

Open marchaesen opened this issue 4 years ago • 2 comments

Version used be80a3f4d0ad691e9b210840c71848a36ee82a6d (fixes branch), linux yocto image on imx8m.

I am sending a topic with qos 1 to a client that has persistant subscriptions and that is sleeping. The topic is not delivered when the clients wakes up and connects to the mosquitto.

The problem only occurs when the per_listener_settings configuration setting is set to true.

After some investigation, the problem is introduced in commit 79542158f47ac589b2248ad40102a3c8e545d413. If I revert this commit, this functionality is working again.

So the following patch fixes the issue, but I assume introduces the problem again that commit 79542158f47ac589b2248ad40102a3c8e545d413 was solving.

diff --git a/lib/net_mosq.c b/lib/net_mosq.c
index bd927191..1d180970 100644
--- a/lib/net_mosq.c
+++ b/lib/net_mosq.c
@@ -250,7 +250,6 @@ int net__socket_close(struct mosquitto *mosq)
 #ifdef WITH_BROKER
 	if(mosq->listener){
 		mosq->listener->client_count--;
-		mosq->listener = NULL;
 	}
 #endif

marchaesen avatar Oct 12 '21 09:10 marchaesen

Thanks! I'll have to take a look to figure out both issues together.

ralight avatar Oct 12 '21 22:10 ralight

Any news about this issue?

marchaesen avatar Apr 02 '24 12:04 marchaesen