And leads to random test failures due to timeout when waiting for sync, as in http://qa.nuxeo.org/jenkins/view/Drive/job/FT-nuxeo-drive-master-osx/749/consoleFull :
00:02:47 [INFO] [exec] FAIL: test_file_readonly_change (nxdrive.tests.test_readonly.TestReadOnly) 00:02:47 [INFO] [exec] ---------------------------------------------------------------------- 00:02:47 [INFO] [exec] Traceback (most recent call last): 00:02:47 [INFO] [exec] File "/Users/hudson/tmp/workspace/FT-nuxeo-drive-master-osx/nuxeo-drive-client/nxdrive/tests/test_readonly.py", line 147, in test_file_readonly_change 00:02:47 [INFO] [exec] self.wait_sync(wait_for_async=True) 00:02:47 [INFO] [exec] File "/Users/hudson/tmp/workspace/FT-nuxeo-drive-master-osx/nuxeo-drive-client/nxdrive/tests/common_unit_test.py", line 256, in wait_sync 00:02:47 [INFO] [exec] self.fail("Wait for sync timeout expired") 00:02:47 [INFO] [exec] AssertionError: Wait for sync timeout expired 00:02:47 [INFO] [exec] -------------------- >> begin captured logging << -------------------- ... 00:02:47 [INFO] [exec] 2015-07-08 23:57:35,871 72733 4773089280 TRACE nxdrive.engine.dao.sqlite Increasing version to 2 for pair RemoteFileInfo(name=u'joe.odt', uid=u'defaultFileSystemItemFactory#default#aa190993-3b24-4135-9730-9c7b68489145', parent_uid=u'defaultFileSystemItemFactory#default#a2b7d3d8-4c76-400c-b58f-c8d2df6f0567', path=u'/org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory#/defaultSyncRootFolderItemFactory#default#44171a50-0013-4fc6-830a-1228ffd4d082/defaultFileSystemItemFactory#default#a2b7d3d8-4c76-400c-b58f-c8d2df6f0567/defaultFileSystemItemFactory#default#aa190993-3b24-4135-9730-9c7b68489145', folderish=False, last_modification_time=datetime.datetime(2015, 7, 8, 23, 57, 29), last_contributor=u'Administrator', digest=u'699d56ed98093dcac5c735d6922baa71', digest_algorithm=u'md5', download_url=u'nxbigfile/default/aa190993-3b24-4135-9730-9c7b68489145/blobholder:0/joe.odt', can_rename=False, can_delete=False, can_update=False, can_create_child=False) 00:02:47 [INFO] [exec] 2015-07-08 23:57:44,479 72733 4773089280 TRACE nxdrive.engine.dao.sqlite Pushing RemoteFileInfo(name=u'joe.odt', uid=u'defaultFileSystemItemFactory#default#aa190993-3b24-4135-9730-9c7b68489145', parent_uid=u'defaultFileSystemItemFactory#default#a2b7d3d8-4c76-400c-b58f-c8d2df6f0567', path=u'/org.nuxeo.drive.service.impl.DefaultTopLevelFolderItemFactory#/defaultSyncRootFolderItemFactory#default#44171a50-0013-4fc6-830a-1228ffd4d082/defaultFileSystemItemFactory#default#a2b7d3d8-4c76-400c-b58f-c8d2df6f0567/defaultFileSystemItemFactory#default#aa190993-3b24-4135-9730-9c7b68489145', folderish=False, last_modification_time=datetime.datetime(2015, 7, 8, 23, 57, 29), last_contributor=u'Administrator', digest=u'699d56ed98093dcac5c735d6922baa71', digest_algorithm=u'md5', download_url=u'nxbigfile/default/aa190993-3b24-4135-9730-9c7b68489145/blobholder:0/joe.odt', can_rename=False, can_delete=False, can_update=False, can_create_child=False) ...
There is 9 seconds between the 2 calls in sqlite.update_remote_state, most certainly spent in self._lock.acquire().