Skip to content

Will Delay Interval #788

Closed
Closed
@redboltz

Description

@redboltz

The example broker doesn't support Will Delay Interval yet.

The spec is ambiguous for me.

https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901062

The Server delays publishing the Client’s Will Message until the Will Delay Interval has passed or the Session ends, whichever happens first. If a new Network Connection to this Session is made before the Will Delay Interval has passed, the Server MUST NOT send the Will Message [MQTT-3.1.3-9].

Consider the following scenario:

  1. c1 connected to the broker with WDI(Will Delay Interval) 10, and SEI(Session Expiry Interval) 0 (Equivalent to be omitted).
  2. c1 disconnected forcibly.
  3. The broker should publish the will immediately because the session ended.

I think that it is meaningless that WDI smaller than SEI because the session ends is always earlier than WDI passed.

Consider the following scenario:

  1. c1 connected to the broker with WDI(Will Delay Interval) 10, and SEI(Session Expiry Interval) 20.
  2. c1 disconnected forcibly.
  3. c1 reconnected with CleanStart 0.
  4. The broker shouldn't send the will even if WDI passed. (Sending the will is cancelled)

It is reasonable.

Consider the following scenario:

  1. c1 connected to the broker with WDI(Will Delay Interval) 10, and SEI(Session Expiry Interval) 20.
  2. c1 disconnected forcibly.
  3. c1 reconnected with CleanStart 1.
  4. The broker should publish the will immediately because the session ended. Is this right ?

"a new Network Connection to this Session is made before the Will Delay Interval has passed" is satisfied.
But "Session ends" by the new connection with CleanStart 1.
So "until the Will Delay Interval has passed or the Session ends" the latter condition is satisfied so the will should be send.
Is this right?

Non-normative comment
If a Network Connection uses a Client Identifier of an existing Network Connection to the Server, the Will Message for the exiting connection is sent unless the new connection specifies Clean Start of 0 and the Will Delay is greater than zero. If the Will Delay is 0 the Will Message is sent at the close of the existing Network Connection, and if Clean Start is 1 the Will Message is sent because the Session ends.

It is the most confusing comment.
What does "the Will Delay is greater than zero" mean?
The existing connection's WDI or the new connection's WDI?
If it is the new connection's WDI, it's contradicts the spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions