-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
transport: do not close channel that can lead to panic #2695
Conversation
@gyuho We were hitting this [0] panic a couple of times and once we have applied this hot fix in etcd v3.3.11 and we haven't gotten any panic so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Can you also delete ok
in runStream()
? It will never be false since writes
is never closed. Thanks!
@menghanl Done! |
`Write` can be called concurrently, for which it calls the `do` function. As `WriteStatus` can close the `ht.writes` in parallel as well the `Write` will try to write into the `ht.writes` in the `do` function, this can lead into a panic. As there is no real usability on closing this channel we can simply leave it to the garbage collector so we can avoid panic during an execution. Signed-off-by: André Martins <aanm90@gmail.com>
It seems master branch is also failing on the same test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
This version includes patch from grpc/grpc-go#2695 which fixes etcd-io#9956 Signed-off-by: André Martins <aanm90@gmail.com>
This version includes patch from grpc/grpc-go#2695 which fixes etcd-io#9956 Signed-off-by: André Martins <aanm90@gmail.com>
full diff: grpc/grpc-go@v1.12.2...v1.20.0 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: grpc/grpc-go@v1.12.2...v1.20.0 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This version includes patch from grpc/grpc-go#2695 which fixes etcd-io#9956 Signed-off-by: André Martins <aanm90@gmail.com>
This version includes patch from grpc/grpc-go#2695 which fixes etcd-io#9956 Signed-off-by: André Martins <aanm90@gmail.com>
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 28ad54d) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 93d76c5) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 93d76c5c9017b8146dcac5f4106e10ba385cce4d Component: cli
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 28ad54d84f05b789e6a5f9a2ff2a5230d2ec886e) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: d371b283c3dd3319350caf23336d6bc93bd5a15d Component: engine
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 93d76c5c9017b8146dcac5f4106e10ba385cce4d) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 57ef4e32f4ee7fac888c5749312f7aa23a11ab7b Component: cli
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby/moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 28ad54d84f05b789e6a5f9a2ff2a5230d2ec886e Component: engine
full diff: grpc/grpc-go@v1.12.2...v1.20.1 includes grpc/grpc-go#2695 transport: do not close channel that can lead to panic addresses moby#39053 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This version includes patch from grpc/grpc-go#2695 which fixes etcd-io#9956 Signed-off-by: André Martins <aanm90@gmail.com>
Write
can be called concurrently, for which it calls thedo
function.As
WriteStatus
can close theht.writes
in parallel as well theWrite
will try to write into the
ht.writes
in thedo
function, this canlead into a panic. As there is no real usability on closing this channel
we can simply leave it to the garbage collector so we can avoid panic
during an execution.
Signed-off-by: André Martins aanm90@gmail.com