Commit c141d798 authored by Jason Yellick's avatar Jason Yellick
Browse files

FAB-14502 Clarify deliver 'Errored' message



The deliver service is currently quite ambiguous about the error
condition when the channel returned by Errored() closes.  This is likely
because this message could be returned by a peer or orderer.  However,
in reality, the only time this condition ever occurs is because of a
consenter error.  In the interest of serviceability, this CR makes the
error message more specific, making a note that we should handle
generalizing it if the peer ever implements this function.

Change-Id: I5c2dfb8fa4ba32c34660b69b5facf90291ee17f3
Signed-off-by: default avatarJason Yellick <jyellick@us.ibm.com>
parent 1bd01d86
......@@ -297,7 +297,9 @@ func (h *Handler) deliverBlocks(ctx context.Context, srv *Server, envelope *cb.E
logger.Debugf("Context canceled, aborting wait for next block")
return cb.Status_INTERNAL_SERVER_ERROR, errors.Wrapf(ctx.Err(), "context finished before block retrieved")
case <-erroredChan:
logger.Warningf("Aborting deliver for request because of background error")
// TODO, today, the only user of the errorChan is the orderer consensus implementations. If the peer ever reports
// this error, we will need to update this error message, possibly finding a way to signal what error text to return.
logger.Warningf("Aborting deliver for request because the backing consensus implementation indicates an error")
return cb.Status_SERVICE_UNAVAILABLE, nil
case <-iterCh:
// Iterator has set the block and status vars
......
......@@ -169,6 +169,8 @@ func (cs *chainSupport) Reader() blockledger.Reader {
// the peer does not have any error conditions that lead to
// this function signaling that an error has occurred.
func (cs *chainSupport) Errored() <-chan struct{} {
// If this is ever updated to return a real channel, the error message
// in deliver.go around this channel closing should be updated.
return nil
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment