-
Matthew Sykes authored
In go, a context is an object that carries cancellation signals across API boundaries. In fabric, contexts are associated with gRPC requests and get propagated through the system. When a request to invoke chaincode is received, the context is propagated to the controller responsible for managing container requests where it is misused. The controller spawns a go routine to handle the container request and signals completion via a channel. The Process function then waits for the request to complete or for the context to get canceled. When the context it canceled, the processor still waits for the request to complete before returning to the caller. This means the operation is never really canceled at this layer and, since it has to complete, it's likely that it has succeeded. Unfortunately, once the context is canceled, the controller returns the cancellation error from the context causing the callers to treat the operation as a failure. As the code downstream of the controller doesn't properly honor the context either and future releases remove it entirely, we'll simply ignore context cancellation signals in the controller. Change-Id: I51d8be9ef41e586c982abe268e6f9e0d61d4d7a7 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
613e8450