eclipse / paho.mqtt.testing

An Eclipse Paho project - a Python broker for testing
https://eclipse.org/paho
Other
108 stars 73 forks source link

Publication expiry test #47

Closed larshesel closed 6 years ago

larshesel commented 6 years ago

Hi,

In the test_publication_expiry test case I was wondering how the session of bclient survives so it is able to receive the (not yet expired) messages after reconnecting with clean_start=False. The first connection is done using clean_start=True, but there's no session expiration passed when connecting, and if I understood the MQTTv5 spec correctly then the session should only survive the connection if the session expiration is set to a value greater than zero.

I probably either misunderstood the spec or the code, but I wasn't able to figure it out yet...

icraggs commented 6 years ago

When I wrote the test, the default session expiry in the spec when not specified was infinite, not zero. In fact, I was instrumental in getting the default changed to avoid state being left around on servers accidentally. I'd forgotten that that change would necessitate this test to be updated.

larshesel commented 6 years ago

Hi, thank you for the explanation I wasn't aware that the spec had changed on that point during the process - and thank you for making the default session expiry zero - that's going to save the world a lot of bother.

And thank you for writing this implementation - it's quite helpful when understanding the spec.

Shall I close this or do you want to keep this issue open for later?

icraggs commented 6 years ago

You can leave it open - I'll refer to this issue when fixing the test and the broker, thanks.

To help understanding of the spec was one purpose of writing this implementation, so it seems like I'm achieving that goal :-)

icraggs commented 6 years ago

Fixed in test and broker. Thanks.