Repository navigation
Conversation
dbus.SystemBus uses the default godbus signal handler. When a signal channel is busy, it hands the signal to a new goroutine, so a later signal can reach the channel first. Notifications are PropertiesChanged signals, so they could be reported out of order. Protocols that split a message over several notifications, such as Bluetooth Mesh proxy SAR, then rebuild a corrupt message. Enable now uses a shared system bus connection of its own, made with the sequential signal handler, which queues the signals of each channel in the order they are read from the bus. The test runs a minimal bus that sends a burst of notifications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux, GATT notifications can reach the notification callback out of order. dbus.SystemBus uses the default godbus signal handler, which hands a signal to a new goroutine when the channel is busy, so a later signal can arrive first (default_handler.go). Protocols that split a message over several notifications, such as Bluetooth Mesh proxy SAR, then rebuild a corrupt message.
Enable now opens its own shared system bus connection with the sequential signal handler, which keeps the bus order per channel. A program that also calls dbus.SystemBus now gets a second connection.
TestNotificationsInOrder runs a minimal D-Bus server on a unix socket, without BlueZ, and sends 1000 numbered notifications. It failed 50 runs out of 50 with the default handler and passes 50 out of 50 with the fix, and 20 out of 20 with -race. make smoketest-linux passes.