HomeThat World

rpc: fix rare deadlock when canceling HTTP call context (#19715)

Authored by Felix Lange <fjl@twurst.com> on Jun 20 2019, 6:36 AM.

Description

rpc: fix rare deadlock when canceling HTTP call context (#19715)

When cancelling the context for a call on a HTTP-based client while the
call is running, the select in requestOp.wait may hit the <-context.Done()
case instead of the <-op.resp case. This doesn't happen often -- our
cancel test hasn't caught this even though it ran thousands of times
on CI since the RPC client was added.

Fixes #19714

Event Timeline

Péter Szilágyi <peterke@gmail.com> committed rGETH8d815e365cd2: rpc: fix rare deadlock when canceling HTTP call context (#19715) (authored by Felix Lange <fjl@twurst.com>).Jun 20 2019, 6:36 AM