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

etcd watch websocket doesn't handle messages longer than 64 KB #12401

Closed
vitalif opened this issue Oct 18, 2020 · 1 comment
Closed

etcd watch websocket doesn't handle messages longer than 64 KB #12401

vitalif opened this issue Oct 18, 2020 · 1 comment

Comments

@vitalif
Copy link
Contributor

vitalif commented Oct 18, 2020

Hi!
There's a problem in grpc-websocket-proxy that affects etcd's websocket watches.
Problem is that it doesn't handle server messages (i.e replies!) longer 64 KB.
The root cause is Golang's bufio.Scanner having a hard-coded maxTokenSize value equal to 64 KB.
Error message in this case is:
time="2020-10-18T15:42:56Z" level=warning msg="scanner err: bufio.Scanner: token too long"
It's easy to reproduce, you just need to create a key/value entry in etcd with a value longer than 64 KB and you won't get it back in the notification.
A simple test example is here: https://gist.github.com/vitalif/a634ac0543e6cacdda4ec288d922d9cf
I've just sent a dirty fix here: tmc/grpc-websocket-proxy#25
I don't know what's the proper way to fix it since it may involve patching Golang standard library so I'm posting it here for your review :)

@vitalif
Copy link
Contributor Author

vitalif commented Oct 19, 2020

Resubmitted a better fix in #12402.

@vitalif vitalif closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant