Skip to content

aborting MqttBroker::run leaves connection handlers running #177

Description

@fabracht

Found in the PR #170 review.

Defect: aborting or dropping the task running MqttBroker::run() does not stop connection handlers that were already accepted. They keep serving their clients and keep writing to session storage.

Effect: code that stops a broker by aborting its task, rather than through graceful shutdown, leaves a half-running broker. In tests this made "crash" tests pass by ordering rather than by crash semantics (PR #170 moved those tests to a child process killed with SIGKILL). Graceful shutdown is not affected.

Evidence: a client connected before the abort still gets PINGRESP after it.

Fix: tie the connection handlers to the lifetime of run(), for example with a cancellation token or a JoinSet owned by run(), so aborting it stops them. Add a test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions