Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybind/ceph_daemon: use small chunk for recv #13804

Merged
merged 1 commit into from Mar 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/pybind/ceph_daemon.py
Expand Up @@ -21,6 +21,7 @@

COUNTER = 0x8
LONG_RUNNING_AVG = 0x4
READ_CHUNK_SIZE = 4096


def admin_socket(asok_path, cmd, format=''):
Expand All @@ -45,7 +46,10 @@ def do_sockio(path, cmd_bytes):

got = 0
while got < l:
bit = sock.recv(l - got)
# recv() receives signed int, i.e max 2GB
# workaround by capping READ_CHUNK_SIZE per call.
want = min(l - got, READ_CHUNK_SIZE)
bit = sock.recv(want)
sock_ret += bit
got += len(bit)

Expand Down