• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mochi-mqtt / server / 9038356648
98%
main: 99%

Build:
Build:
LAST BUILD BRANCH: fix/mqtt-qos2-reject-packet-type
DEFAULT BRANCH: main
Ran 12 May 2024 09:27AM UTC
Jobs 1
Files 30
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 May 2024 09:33PM UTC coverage: 97.934% (-0.7%) from 98.622%
9038356648

Pull #402

github

snej
Allow a Hook to reload an individual client session

In a clustered environment, client connections are distributed among
multiple Server instances on different machines. After a client
disconnects, leaving behind a persistent session state, its next
login is likely to be on a different node. Because of this, in such a
setup an individual Server instance should only keep Client instances
corresponding to online client connections, and it should be able to
reload an individual client's state (presumably from persistent
storage) when that client connects.

This commit adds support for such an environment by adding a new hook
`StoredClientByID`. An implementation finds and returns any
persistent client data for a given session ID. In practice the only
necessary information turned out to be the saved subscriptions and
in-flight ack messages. The hook also returns the prior 'Remote'
property since the server logs that.

The Server method `inheritClientSession` is extended to call this hook
if there is no matching in-memory Client session. If the hook returns
session data, it installs it into the Client object in the same way
as the existing code.

At the end of the Server method `attachClient`, after disconnection,
the existence of a `StoredClientByID` hook is checked; if present,
the method expires the Client instance so it won't hang around in
memory and so the next connection will go to the hook to reload
state.
Pull Request #402: Allow a Hook to reload an individual client session

24 of 68 new or added lines in 2 files covered. (35.29%)

6163 of 6293 relevant lines covered (97.93%)

60.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9038356648.1 12 May 2024 09:27AM UTC 0
97.93
GitHub Action Run
Source Files on build 9038356648
Detailed source file information is not available for this build.
  • Back to Repo
  • Pull Request #402
  • PR Base - main (#8892157277)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc