summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2020-03-21 16:44:09 -0700
committerJosh Gao <jmgao@google.com>2020-03-23 17:36:15 -0700
commita8776b49136b966612a02047967e10b82530317b (patch)
treeb7bc6261f6ee34d8915425abadc9029a736fe4e5 /trusty/coverage/coverage.cpp
parent65396f473431c9b8a9c2101d649f4ce16a6a4eff (diff)
adb: fix sync.
adbd's file sync service doesn't handle a full socket gracefully, immediately terminating the service as soon as it fails to write a response. This would generally be fine if the socket's buffer were as large as it claims (212992 by default with a 64-bit kernel), but this buffer size is a giant lie, as each write has 576 bytes of overhead that's used up in the send buffer. When setting the send buffer size, the kernel helpfully doubles the value to attempt to account for the overhead, but when writing 8 byte responses, only 2% of the buffer actually gets used for responses, so we run out of buffer after 364 files instead of the 26624 that would be expected. Fix this by processing the responses as they become available, and calculate a maximum limit to how many sends we dispatch before we stop and wait for responses to come in. Bug: http://b/150827486 Test: manually modified adbd to respond with giant error messages, and modified adb to not read responses until we choose to block Change-Id: Ieb8c935662864211e2fd16c337ffed0992990086 (cherry picked from commit 672cdfeeff8ad64622a529ed0c4d1b6923df7539)
Diffstat (limited to 'trusty/coverage/coverage.cpp')
0 files changed, 0 insertions, 0 deletions