Repository navigation
Releases
ubusio v0.2.2
Pre-1.0: the API may still change. No change of the exported API against v0.2.1.
Fixes three defects of subscriptions and notifications.
Changed behaviour
UnsubscribeandUnsubscribeIDcarry the removal through whatever happens to their context, which bounds only the wait. A later subscription to the same object is sent after it. While the connection is lost they return nil: the subscription went with the session.NotifyWaitreturns one result for a subscriber that ubusd lists several times. It is done when every delivery is answered, holds the data of all and the first status other thanStatusOK.
Fixed
UnsubscribeorUnsubscribeIDwith an already ended context forgot the subscription without removing it at ubusd; subscribing again then delivered twice.- A target removed before the subscription to it was recorded left a path subscription marked as made, so it was not made again when the object returned. A watched path now stays pending; a
Subscribethat was making the subscription returnsStatusNotFound. NotifyWaitdid not return before its context ended when another client had subscribed the same subscriber to the object twice.
Known issues
- If the removal request of
UnsubscribeorUnsubscribeIDcannot be sent in time, the subscription stays at ubusd until theSubscriberis closed, and subscribing again then delivers twice. See the changelog.
Verification
Compatibility and unit tests on an MT7981 router (OpenWrt 25.12.5, arm64) and an Orange Pi Zero (OpenWrt 21.02.2, ARMv7); an arm64 virtual machine with ubusd of OpenWrt 21.02 and 25.12 (race detector included); scripts/ci.sh and GitHub Actions.
10 minute stress runs passed on both routers. Not run for this release: emulation, 10 minute stress runs on the virtual machine, benchmarks:
docs/compatibility.md.
See CHANGELOG.md.
ubusio v0.2.1
Pre-1.0: the API may still change. No change of the exported API against v0.2.0.
Fixes the known issues listed for v0.2.0.
Changed behaviour
- The default request timeout bounds a whole operation, the wait for a new connection and for a restore under way included.
WithRequestTimeout(0)disables it. - The subscription changes of one
Subscribertake turns. Subscribeof a path that is only watched, because the object is missing, returnsStatusNotFound(the watch stays) instead of nil.
Fixed
- Waiting for another subscription change ignored the caller's context.
- A cancelled
Subscribe,WatchorSubscribeIDcould leave the subscription at ubusd. - A concurrent call for the same target could report success before the subscription existed.
- Subscribing by path and by id to one object delivered notifications twice.
- A cut off lazy connection attempt could report
i/o timeoutinstead ofcontext.DeadlineExceeded. Subscriberacing with the appearance of the object could reportStatusNotFound.
See CHANGELOG.md, also for the known issues.
Verification
An arm64 virtual machine with ubusd of OpenWrt 21.02 and 25.12 (race detector included) and scripts/ci.sh.
Not run for this release: physical hardware, emulation, long stress runs, benchmarks:
docs/compatibility.md.
ubusio v0.2.0
Pre-1.0: the API may still change.
Added
Conn.Shutdown(ctx): graceful close with a drain.- File descriptor passing (SCM_RIGHTS):
Conn.CallFD,CallIDFD,Request.TakeFD,Request.SetReplyFD. Conn.Monitor: the ubus monitor interface (root only).
Changed behaviour
- Redesigned connection lifecycle: one connection attempt at a time,
Closeinterrupts blocked I/O. Objectsand wildcardLookupare bounded byWithReplyLimits.- Fewer allocations and context switches per request.
Exported API against v0.1.2: only additions. New Stats fields break unkeyed Stats literals.
See CHANGELOG.md for the full list and the known issues.
Verification
Run on two physical routers (OpenWrt 25.12.5 arm64, OpenWrt 21.02.2 ARMv7), an arm64 virtual machine
(21.02 and 25.12, race detector) and under x86-64 emulation. No amd64 or mips hardware.
Exact commits, counts and runs not made:
docs/compatibility.md.
Performance
libubus is faster than ubusio in the speed measurements on both routers:
docs/performance-results.md.