Topic: Publish - Qos 2 early exit (should wait for PUBREL)

The Qos level 2 protocol sequence for Publishing is:
PUBLISH -> PUBREC -> PUBREL -> PUBCOMP

The MQTT v1.9.0 library exists (as SUCCESS) after sending the PUBREL and does not wait for the arrival of the PUBCOMP.
This early exit opens up the opportunity for the system to begin other transfers and then experiencing the unexpectant arrival of the PUBCOMP message.

As a gentle hint, the "waitMatchFound" (line 900 in mqtt_client.c) is set by the arrival of the PUBREC message,
so the library does not "wait_again" (line 996 in mqtt_client.c).

At the time of the premature exit, there is insufficient indications (in the library variables) that allow me to do an external work-around.
Could I kindly ask you to look into and resolve this issue, as it does lead to instability in our system.
Kelvin

Share

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hello Kelvin,

Are you testing with the latest master copy from https://github.com/wolfSSL/wolfMQTT/ ?

This issue should have been fixed with:
https://github.com/wolfSSL/wolfMQTT/pull/231

If there is still an issue, please open a ticket with support@wolfssl.com or in https://github.com/wolfSSL/wolfMQTT/issues

Thanks,
Eric @wolfSSL Support

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi,

My apologies.
We only received MQTT v1.9.0 library at the beginning of August 2021, so it is this new official release that I have been testing.

There did not seem to be any other posts with similar issues, but it is good to know that you are improving the library in the background.

I have been trying to track down a potentially nasty issue, where an incoming message arrives during an outgoing process and subsequently crashes the library.
Consequently, I have been isolating the processes and coming across these other side issues along the way as I closely examine the operation of the Wolf library.

Once again my apologises if these issues have already been resolved.
I am a simple implementer and put my faith in the official releases.
I was unaware that I had to track your other activities.
Anyway, I can acquire your latest github changes, and retest (hopefully, all is good, no more posts from me and you can rest !!).

I guess that Wolf will do another official release soon - do you have a expected release date ?

Kelvin

Share

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi Kelvin,

Thanks for living on the bleeding edge of wolfMQTT development! We try to synchronize wolfMQTT releases with wolfSSL, and wolfSSL is currently in testing for a release. Best guess for a wolfMQTT release would be sometime in the next 6 weeks.

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi,

I am still bleeding !!
I tested the library code from github master pull request #238.
Unfortunately, the code changes up to this merge did not resolve the Qos 2 early exit issue.

Hint:
The "waitMatchFound" is still being set by the PUBREC message in code snippet (to show you what I am testing):

            if ((wait_type == MQTT_PACKET_TYPE_ANY ||
                 wait_type == packet_type ||
                 (MqttIsPubRespPacket(packet_type) &&
                  MqttIsPubRespPacket(wait_type))) &&
                (wait_packet_id == 0 || wait_packet_id == packet_id))
            {
                use_packet_obj = packet_obj;
                waitMatchFound = 1;
            }

Is there another update that I can try ?
Kelvin

Share

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi Kelvin,

I will check this out. I created a github issue to better track the report here:
https://github.com/wolfSSL/wolfMQTT/issues/239

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi Kelvin,

Thanks again for your excellent report on this issue. I created a fix here:
https://github.com/wolfSSL/wolfMQTT/pull/240

Please let me know if this also fixes the problem from your perspective.

Thanks,
Eric @wolfSSL Support

8 (edited by Kelvin 2021-10-12 03:41:00)

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi,

I consider code development as a iterative process.

Since I am now examining your "development code" in github, I think that it is unfair and inappropriate to air my findings in this forum which is more about the stable releases.

If you do not mind, I will report my findings to the github #239, and give you a chance to assess and fix any issues that I might raise. It will also allow the issues to be tracked, the code to be modified & then tested by your QA system, and allow stabilised releases to be provided when the issues are resolved.

The only downside is when other forum users come across issues, and have not checked in github to see if their issues have been resolved in a pending release candidate.

At a later date, I will come back to each of my issues raised in this forum and indicate their successful conclusion.

I hope that this suggested approach is acceptable to you and the forum users.
Kelvin

Share

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hello Kelvin,

GitHub is also a public facing platform. If there are issues you would prefer to keep more private, you can also send a message to support@wolfssl.com, which will create a ticket in our ZenDesk issue tracker.

Kind regards,
Eric @ wolfSSL Support

Re: Publish - Qos 2 early exit (should wait for PUBREL)

Hi,

The latest code modification (github #240) did FIX the "Qos 2 early exit" issue.

However I found another issue, in the github code after the v1.9.0 release.
I did not want to flood this forum with numerous issues in not-yet-released code.
I am just trying to find the right procedure to report these issues to you.

Sorry if I am not using the correct procedures.
Kelvin

Share

Re: Publish - Qos 2 early exit (should wait for PUBREL)

HI Kelvin,

Thanks for confirming the fix. Most customers of wolfSSL utilize the ZenDesk platform by emailing `support@wolfssl.com`. Tickets in ZenDesk are monitored and more closely tracked.

You are welcome to use whichever method suits you.