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

v3rpc: use MaxRecvMsgSize and MaxSendMsgSize to limit msg size #8437

Merged
merged 1 commit into from
Aug 24, 2017

Conversation

fanminshi
Copy link
Member

@fanminshi fanminshi commented Aug 22, 2017

grpc 1.3 uses MaxMsgSize() to limit received message size. However, grpc 1.4 introduces a 4mb default limit on send message size. In etcd, server shouldn't be limiting size of message that it can be sent. Hence, set maximum size of send message using MaxSendMsgSize().

@gyuho gyuho added this to the v3.3.0 milestone Aug 22, 2017
@@ -31,6 +31,7 @@ import (
const (
grpcOverheadBytes = 512 * 1024
maxStreams = math.MaxUint32
maxSendBytes = math.MaxUint32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sent size, maybe we also want to make it configurable eventually. then users can limit the size of outbound response. one client wont eat up all bandwidth through a single huge list/watch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I do that for this pr or wait until user asks for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @heyitsanthony opinion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unlimited until someone asks; abusive clients can chew through bandwidth even with a send limit

…Size

grpc 1.3 uses MaxMsgSize() to limit received message size. However, grpc 1.4 introduces a 4mb default limit on send message size. In etcd, server shouldn't be limit size of message that it can be sent. Hence, set maximum size of send message using MaxSendMsgSize().
@heyitsanthony
Copy link
Contributor

Is anything hitting this limit?

@xiang90
Copy link
Contributor

xiang90 commented Aug 23, 2017

k8s is failing on large clusters. I assume anyone does unlimited initial cache catch-up will fail similarly.

@fanminshi
Copy link
Member Author

fanminshi commented Aug 23, 2017

via https://jenkins-etcd-public.prod.coreos.systems/job/etcd-coverage/2094/consoleFull

--- FAIL: TestCtlV3Elect (1.16s)
	ctl_v3_elect_test.go:48: got "2017-08-22 22:48:24.408678 W | pkg/flags: unrecognized environment variable ETCDCTL_ARGS=../bin/etcdctl\xe7\xcd--endpoints=http://localhost:20000\xe7\xcd--dial-timeout=7s\xe7\xcdelect\xe7\xcda\xe7\xcdp1\r\n", expected "a" prefix
	ctl_v3_elect_test.go:60: should block
--- FAIL: TestCtlV3PutIgnoreLease (0.96s)
	ctl_v3_kv_test.go:127: putTestIgnoreLease: ctlV3Get error (unexpected output (got lines [], line count 3))
--- FAIL: TestCtlV3LeaseRevoke (0.84s)
	ctl_v3_lease_test.go:105: leaseTestRevoke: ctlV3Get error (unexpected output (got lines [], line count 3))
--- FAIL: TestCtlV3Lock (0.47s)
	ctl_v3_lock_test.go:48: got "2017-08-22 22:52:07.503502 W | pkg/flags: unrecognized environment variable ETCDCTL_ARGS=../bin/etcdctl\xe7\xcd--endpoints=http://localhost:20003\xe7\xcd--dial-timeout=7s\xe7\xcdlock\xe7\xcda\r\n", expected "a" prefix
	ctl_v3_lock_test.go:60: should block

I don't think it is related to this pr.

edit: lots failure from coverage run.

@xiang90
Copy link
Contributor

xiang90 commented Aug 23, 2017

@fanminshi seems unrelated. lgtm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants