New issue
Advanced search Search tips

Issue 655931 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 583544
Owner: ----
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 421668



Sign in to add a comment

bluetooth: parallel BluetoothDevice connects raise errors

Project Member Reported by fbeaufort@chromium.org, Oct 14 2016

Issue description

Google Chrome	55.0.2883.7 (Official Build) dev (64-bit)
Platform	8872.6.0 (Official Build) dev-channel link

What steps will reproduce the problem?
(1) Go to https://beaufortfrancois.github.io/sandbox/web-bluetooth/parallel-connects/
(2) Make sure a Bluetooth device advertising the Battery Service is nearby
(3) Click "Test" button
(4) Open Dev Tools

What is the expected output?
I should see three times the battery level.

What do you see instead?

(index):1 Uncaught (in promise) DOMException: Connection failed for unknown reason.
(index):1 Uncaught (in promise) DOMException: Connection failed for unknown reason.
(index):24 Battery level is  50

I believe this happens because device.gatt.connect is done three times in parallel: https://github.com/beaufortfrancois/sandbox/blob/gh-pages/web-bluetooth/parallel-connects/index.html#L14 

Here are Chrome logs:

[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(54)] requestDevice called with the following filters: 
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(57)] Filter #1
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(65)] Services: 
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(66)] 	[
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(68)] 		0000180f-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(69)] 	]
[20684:20684:1014/091713:VERBOSE1:bluetooth_adapter_bluez.cc(1289)] AddDiscoverySession
[20684:20684:1014/091713:VERBOSE1:bluetooth_adapter_bluez.cc(1583)] OnSetDiscoveryFilter
[20684:20684:1014/091713:VERBOSE1:bluetooth_adapter_bluez.cc(1468)] OnStartDiscovery
[20684:20684:1014/091713:VERBOSE1:bluetooth_adapter.cc(294)] BluetoothAdapter::OnStartDiscoverySession
[20684:20684:1014/091713:VERBOSE1:bluetooth_device_chooser_controller.cc(441)] Started discovery session.
[20684:20684:1014/091714:VERBOSE1:bluetooth_adapter_bluez.cc(1022)] Discovering changed: 1
[20684:20684:1014/091715:VERBOSE1:bluetooth_discovery_session.cc(45)] Stopping device discovery session.
[20684:20684:1014/091715:VERBOSE1:bluetooth_adapter_bluez.cc(1352)] RemoveDiscoverySession
[20684:20684:1014/091715:VERBOSE1:bluetooth_allowed_devices_map.cc(28)] Adding a device to Map of Allowed Devices.
[20684:20684:1014/091715:VERBOSE1:bluetooth_allowed_devices_map.cc(46)] Id generated for device: P3yFHVd56P8sUQrcVW5ABg==
[20684:20684:1014/091715:VERBOSE1:web_bluetooth_service_impl.cc(783)] Device: Nexus 5X
[20684:20684:1014/091715:VERBOSE1:web_bluetooth_service_impl.cc(784)] UUIDs: 
[20684:20684:1014/091715:VERBOSE1:web_bluetooth_service_impl.cc(790)] 	 Allowed: 0000180f-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091715:VERBOSE1:web_bluetooth_service_impl.cc(793)] 	 Not Allowed: 00001801-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091715:VERBOSE1:web_bluetooth_service_impl.cc(793)] 	 Not Allowed: 00001800-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091715:VERBOSE1:bluetooth_adapter_bluez.cc(1515)] OnStopDiscovery
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(438)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting, 1 in progress
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(755)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(438)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting, 2 in progress
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(755)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(438)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting, 3 in progress
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(755)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connecting
[20684:20684:1014/091715:VERBOSE1:bluetooth_adapter_bluez.cc(1022)] Discovering changed: 0
[20684:20684:1014/091715:WARNING:bluetooth_device_bluez.cc(800)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Failed to connect device: org.bluez.Error.Failed: Operation already in progress
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(803)] /org/bluez/hci0/dev_76_73_37_76_B3_15: 2 still in progress
[20684:20684:1014/091715:WARNING:bluetooth_device_bluez.cc(800)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Failed to connect device: org.bluez.Error.Failed: Operation already in progress
[20684:20684:1014/091715:VERBOSE1:bluetooth_device_bluez.cc(803)] /org/bluez/hci0/dev_76_73_37_76_B3_15: 1 still in progress
[20684:20684:1014/091716:VERBOSE1:bluetooth_device_bluez.cc(771)] /org/bluez/hci0/dev_76_73_37_76_B3_15: Connected, 0 still in progress
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(440)] Services not yet discovered.
[20684:20684:1014/091716:VERBOSE3:bluetooth_device_bluez.cc(693)] Updating the list of GATT services associated with device /org/bluez/hci0/dev_76_73_37_76_B3_15
[20684:20684:1014/091716:VERBOSE1:bluetooth_device_bluez.cc(631)] Remote GATT service already exists: /org/bluez/hci0/dev_76_73_37_76_B3_15/service0001
[20684:20684:1014/091716:VERBOSE1:bluetooth_device_bluez.cc(631)] Remote GATT service already exists: /org/bluez/hci0/dev_76_73_37_76_B3_15/service0028
[20684:20684:1014/091716:VERBOSE2:bluetooth_device_bluez.cc(641)] Remote GATT service does not belong to this device.
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(268)] Services discovered for device: 76:73:37:76:B3:15
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(268)] Services discovered for device: 76:73:37:76:B3:15
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(158)] Looking for service: 0000180f-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 0000180f-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 00001801-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(746)] Services found in device.
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(139)] Looking for characteristic: 00002a19-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091716:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a19-0000-1000-8000-00805f9b34fb
[20684:20684:1014/091716:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_76_73_37_76_B3_15/service0028/char0029, UUID: 00002a19-0000-1000-8000-00805f9b34fb.
[20684:20684:1014/091716:VERBOSE2:bluetooth_gatt_characteristic_client.cc(235)] Remote GATT characteristic property changed: /org/bluez/hci0/dev_76_73_37_76_B3_15/service0028/char0029: Value
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
[20684:20684:1014/091716:VERBOSE3:bluetooth_remote_gatt_service_bluez.cc(227)] Properties of unknown characteristic changed
 

Comment 1 by ortuno@chromium.org, Oct 16 2016

Mergedinto: 583544
Status: Duplicate (was: Available)

Sign in to add a comment