Avatar for the Bluetooth-Devices user
Bluetooth-Devices
dbus-fast
BlogDocsChangelog

fix(message_bus): prevent socket leak on connection error

#491
Comparing
skbeh:socket-leak-on-connect-error
(
b5577e1
) with
main
(
5afc3a9
)
CodSpeed Performance Gauge
-1%
Improvements
0
Regressions
0
Untouched
6
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

test_marshall_bluez_get_managed_objects_message
tests/benchmarks/test_marshall.py::test_marshall_bluez_get_managed_objects_message
CodSpeed Performance Gauge
+1%
68.9 µs
68.5 µs
test_unmarshall_multiple_bluez_properties_message
tests/benchmarks/test_unmarshall.py::test_unmarshall_multiple_bluez_properties_message
CodSpeed Performance Gauge
0%
96 µs
96.3 µs
test_unmarshall_bluez_properties_message
tests/benchmarks/test_unmarshall.py::test_unmarshall_bluez_properties_message
CodSpeed Performance Gauge
0%
42.4 µs
42.6 µs
test_unmarshall_bluez_rssi_message
tests/benchmarks/test_unmarshall.py::test_unmarshall_bluez_rssi_message
CodSpeed Performance Gauge
-1%
43.5 µs
43.7 µs
test_unmarshall_multiple_bluez_properties_message_socket
tests/benchmarks/test_unmarshall.py::test_unmarshall_multiple_bluez_properties_message_socket
CodSpeed Performance Gauge
-1%
96.5 µs
97.4 µs
test_unmarshall_bluez_interfaces_added_message
tests/benchmarks/test_unmarshall.py::test_unmarshall_bluez_interfaces_added_message
CodSpeed Performance Gauge
-2%
64.9 µs
66 µs

Commits

Click on a commit to change the comparison range
Base
main
5afc3a9
-0.53%
fix(message_bus): prevent socket leak on connection error In the `_setup_socket` method, if an exception occurred during the connection attempt, the underlying socket file descriptor was not being closed. This commit refactors the socket connection logic to ensure that if an error is present after trying all available bus addresses, the socket is explicitly closed before the connection error is raised.
b5577e1
12 days ago
by skbeh
© 2025 CodSpeed Technology
Home Terms Privacy Docs