New issue
Advanced search Search tips

Issue 647335 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Fix race condition in python-adb

Project Member Reported by bpastene@chromium.org, Sep 15 2016

Issue description

Looks like the host waits for an ACK packet from the device after the actual connection is closed:

'NoneType' object has no attribute 'next' Traceback (most recent call last): File "swarming_bot.1.zip/bot_code/bot_main.py", line 143, in get_state state = bot_config.get_state(botobj) File "swarming_bot.1.zip/config/bot_config.py", line 812, in get_state state = os_utilities.get_state_all_devices_android(devices) File "swarming_bot.1.zip/api/os_utilities.py", line 858, in get_state_all_devices_android for device, out in zip(devices, parallel.pmap(fn, devices)) File "swarming_bot.1.zip/adb/contrib/parallel.py", line 50, in pmap return _pmap(_POOL, _QUEUE_IN, _QUEUE_OUT, fn, items) File "swarming_bot.1.zip/adb/contrib/parallel.py", line 91, in _run result = fn(item) File "swarming_bot.1.zip/api/os_utilities.py", line 841, in fn u'cpu': device.GetCPUScale(), File "swarming_bot.1.zip/adb/contrib/high.py", line 486, in GetCPUScale for k, v in mapping.iteritems() File "swarming_bot.1.zip/adb/contrib/high.py", line 486, in <dictcomp> for k, v in mapping.iteritems() File "swarming_bot.1.zip/adb/contrib/high.py", line 427, in PullContent return self._device.PullContent(*args, **kwargs) File "swarming_bot.1.zip/adb/contrib/adb_commands_safe.py", line 289, in PullContent return self._adb_cmd.Pull(remotefile, None) File "swarming_bot.1.zip/adb/adb_commands.py", line 158, in Pull connection, device_filename, dest_file) File "swarming_bot.1.zip/adb/filesync_protocol.py", line 83, in Pull for cmd_id, _, data in cnxn.ReadUntil(('DATA',), 'DONE'): File "swarming_bot.1.zip/adb/filesync_protocol.py", line 200, in ReadUntil cmd_id, header, data = self.Read(expected_ids + finish_ids) File "swarming_bot.1.zip/adb/filesync_protocol.py", line 172, in Read self._Flush() File "swarming_bot.1.zip/adb/filesync_protocol.py", line 212, in _Flush self.adb.ReadUntil('OKAY') File "swarming_bot.1.zip/adb/adb_protocol.py", line 361, in ReadUntil message = self._yielder.next() AttributeError: 'NoneType' object has no attribute 'next'

Host reboot rarely does the trick. Usually need a device reboot.
 
Owner: bpastene@chromium.org
Status: Assigned (was: Untriaged)

Comment 2 by stip@chromium.org, Dec 15 2016

Was this addressed? Can we close this?
Status: Fixed (was: Assigned)
Addressed with https://github.com/luci/python-adb/commit/e01e01fa3f863556d1748f71cd6e20bfa0e03e3e

Sign in to add a comment