Skip to content

Conversation

@MattBrittan
Copy link
Contributor

Manual acknowledgments can occur at any time. matchAndDispatch was not allowing for this fully, when the connection was lost/terminated a panic was possible where an Ack was sent after the matchAndDispatch goroutine terminated. This fix simplifies the handling of Ack packets and should resolve the issue (test included).

Note that this is not a complete solution (ignoring an ACK after the connection has dropped will not always be the right option).

ref #726

Matt Brittan added 2 commits September 16, 2025 15:54
Measures were added in 2021 to ensure that matchAndDispatch waited for handlers to complete
before exiting. Unfortunately this did not fully account for manual acknowledgments (which could
be triggered at any time). This change simplifies Ack handling to avoid the issue (includes a test). Note that this is not a complete solution (ignoring an ACK after the connection has dropped will not always be the right option).

Ref issue #726
@MattBrittan MattBrittan merged commit 35ee03d into master Sep 16, 2025
1 check passed
algitbot pushed a commit to alpinelinux/build-server-status that referenced this pull request Nov 9, 2025
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/eclipse/paho.mqtt.golang](https://github.com/eclipse/paho.mqtt.golang) | require | patch | `v1.5.0` -> `v1.5.1` |

---

### Release Notes

<details>
<summary>eclipse/paho.mqtt.golang (github.com/eclipse/paho.mqtt.golang)</summary>

### [`v1.5.1`](https://github.com/eclipse-paho/paho.mqtt.golang/releases/tag/v1.5.1)

[Compare Source](eclipse-paho/paho.mqtt.golang@v1.5.0...v1.5.1)

This is a minor release incorporating changes made in the 14 months since v1.5.0 (including updating dependencies, and raising the Go version to 1.24). The changes are relatively minor but address a potential security issue, possible panic, enable users to better monitor the connection status, and incorporate a few optimisations.

Thanks to those who have provided fixes/enhancements included in this release!

Special thanks to Paul Gerste at [Sonar](https://www.sonarsource.com/) for reporting issue [#&#8203;730](eclipse-paho/paho.mqtt.golang#730) via the Eclipse security team (fix was implemented in MR [#&#8203;714](eclipse-paho/paho.mqtt.golang#714) in May, github issue created just prior to this release). This issue arose where a topic > 65535 bytes was passed to the `Publish` function, due to the way the data was encoded the topic could leak into the message body. Please see issue [#&#8203;730](eclipse-paho/paho.mqtt.golang#730) for further details.

#### What's Changed

- Updating go dependencies from pub and sub into the containers before building by [@&#8203;JefJrFigueiredo](https://github.com/JefJrFigueiredo) in [eclipse-paho#691](eclipse-paho/paho.mqtt.golang#691)
- Optimize TCP connection logic by [@&#8203;geekeryy](https://github.com/geekeryy) in [eclipse-paho#713](eclipse-paho/paho.mqtt.golang#713)
- Fields over 65535 bytes not encoded correctly by [@&#8203;MattBrittan](https://github.com/MattBrittan) in [eclipse-paho#714](eclipse-paho/paho.mqtt.golang#714)
- Reduce slice allocations in route dispatch  by [@&#8203;alespour](https://github.com/alespour) in [eclipse-paho#710](eclipse-paho/paho.mqtt.golang#710)
- Add a ConnectionNotificationHandler by [@&#8203;RangelReale](https://github.com/RangelReale) in [eclipse-paho#727](eclipse-paho/paho.mqtt.golang#727)
- Potential panic when using manual ACK by [@&#8203;MattBrittan](https://github.com/MattBrittan) in [eclipse-paho#729](eclipse-paho/paho.mqtt.golang#729)

**Full Changelog**: <eclipse-paho/paho.mqtt.golang@v1.5.0...v1.5.1>

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

&nbsp;
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

See merge request alpine/infra/build-server-status!22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants