Skip to content

Conversation

@MattBrittan
Copy link
Contributor

This is a major change that moves handling of the status (i.e. disconnected, connecting etc) out to status.go. It also introduces the new status disconnecting.

All existing tests (including 10000 runs through Test_DisconnectWhileProcessingIncomingPublish) pass and I have added new ones to specifically test the connectionStatus functionality. However this is a major change so bugs may have been introduced!

The major aim of this change is to simplify future work, It has been difficult to implement changes/refactor because the status handling was fragile (and not fully thread safe in some instances).

@MattBrittan MattBrittan merged commit 079a117 into eclipse-paho:master Aug 10, 2022
algitbot pushed a commit to alpinelinux/build-server-status that referenced this pull request May 5, 2024
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.4.1` -> `v1.4.3` |

---

### Release Notes

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

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

[Compare Source](eclipse-paho/paho.mqtt.golang@v1.4.2...v1.4.3)

Release 1.4.3 is a relatively small release to bring in changes made in the eight months since 1.4.2.

Thanks to everyone who submitted issues and contributed code (list of the main merged pull requests below):

#### What's Changed

-   Avoid Panic when keepalive is 1 by [@&#8203;tomatod](https://github.com/tomatod) in [#&#8203;622](eclipse-paho/paho.mqtt.golang#622)
-   Allow MQTT username/password in websocket URI [@&#8203;MattBrittan](https://github.com/MattBrittan) in [#&#8203;624](eclipse-paho/paho.mqtt.golang#624)
-   Add backoff when reconnecting following immediate connection loss [@&#8203;tomatod](https://github.com/tomatod) in [#&#8203;625](eclipse-paho/paho.mqtt.golang#625)
-   Update dependencies (github.com/gorilla/[email protected], golang.org/x/net, golang.org/x/sync) and specify `go 1.18` in `go.mod`.

**Full Changelog**: eclipse-paho/paho.mqtt.golang@v1.4.2...v1.4.3

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

[Compare Source](eclipse-paho/paho.mqtt.golang@v1.4.1...v1.4.2)

Release 1.4.2 is relatively small and is mostly focused on tidying up the way the library manages the connection status. Previously `sync/
atomic` was used to read/update the status but this led to a range of potential deadlocks, and workarounds to avoid these, which made the code difficult to follow. The new [connectionStatus](https://github.com/eclipse/paho.mqtt.golang/blob/master/status.go#L113) separates status handling from `client` and should simplify further development whilst resolving potential race conditions. It is my hope that users will not notice any change ([@&#8203;master](https://github.com/master) was updated on 10th August and the updated code has been running in production at a few sites since then without issue).

A further change is that it is now possible to disable auto acknowledgment so that received messages can be manually acknowledged (or, more to the point, not acknowledged!).

Thanks to everyone who submitted issues and contributed code (list of the main merged pull requests below):

#### What's Changed

-   Tidy up use of mutex in `messageIds` by [@&#8203;MattBrittan](https://github.com/MattBrittan) in [#&#8203;602](eclipse-paho/paho.mqtt.golang#602)
-   Resolve situation where broker accepted connection but did not respond to CONNECT packet in a timely manner (should be very unusual but was reported in [#&#8203;597](eclipse-paho/paho.mqtt.golang#597)).  [@&#8203;MattBrittan](https://github.com/MattBrittan) in [#&#8203;603](eclipse-paho/paho.mqtt.golang#603)
-   Resolve race condition in test  by [@&#8203;MattBrittan](https://github.com/MattBrittan) in [#&#8203;606](eclipse-paho/paho.mqtt.golang#606)
-   Re-architect status handling by [@&#8203;MattBrittan](https://github.com/MattBrittan) in [#&#8203;607](eclipse-paho/paho.mqtt.golang#607)
-   Enable manual ACK by [@&#8203;shivamkm07](https://github.com/shivamkm07) in [#&#8203;578](eclipse-paho/paho.mqtt.golang#578)

#### New Contributors

-   [@&#8203;shivamkm07](https://github.com/shivamkm07) made their first contribution in [#&#8203;578](eclipse-paho/paho.mqtt.golang#578)

**Full Changelog**: eclipse-paho/paho.mqtt.golang@v1.4.1...v1.4.2

</details>

---

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

---

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

See merge request alpine/infra/build-server-status!8
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.

1 participant