{"record":{"id":"e031a552d9375880","repo":"hyperledger/fabric","slug":"stream-d-aborted","errorCode":null,"errorMessage":"stream %d aborted","messagePattern":"stream (.+?) aborted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/cluster/stream.go","lineNumber":59,"sourceCode":"}\n\n// StreamOperation denotes an operation done by a stream, such a Send or Receive.\ntype StreamOperation func() (*orderer.StepResponse, error)\n\n// Canceled returns whether the stream was canceled.\nfunc (stream *Stream) Canceled() bool {\n\treturn atomic.LoadUint32(stream.canceled) == uint32(1)\n}\n\n// Send sends the given request to the remote cluster member.\nfunc (stream *Stream) Send(request *orderer.StepRequest) error {\n\treturn stream.SendWithReport(request, func(_ error) {})\n}\n\n// SendWithReport sends the given request to the remote cluster member and invokes report on the send result.\nfunc (stream *Stream) SendWithReport(request *orderer.StepRequest, report func(error)) error {\n\tif stream.Canceled() {\n\t\treturn errors.New(stream.abortReason.Load().(string))\n\t}\n\tvar allowDrop bool\n\t// We want to drop consensus transactions if the remote node cannot keep up with us,\n\t// otherwise we'll slow down the entire FSM.\n\tif request.GetConsensusRequest() != nil {\n\t\tallowDrop = true\n\t}\n\n\treturn stream.sendOrDrop(request, allowDrop, report)\n}\n\n// sendOrDrop sends the given request to the remote cluster member, or drops it\n// if it is a consensus request and the queue is full.\nfunc (stream *Stream) sendOrDrop(request *orderer.StepRequest, allowDrop bool, report func(error)) error {\n\tmsgType := \"transaction\"\n\tif allowDrop {\n\t\tmsgType = \"consensus\"\n\t}","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/cluster/stream.go#L41-L77","documentation":"Stream.SendWithReport checks whether the stream was canceled before sending; if so, it returns an error whose message is the stored abortReason, typically \"stream N aborted\". Streams are aborted when the remote node fails, the connection dies, or the stream is reaped due to inactivity/queue overflow, so consensus messages or submit forwards cannot be delivered.","triggerScenarios":"Send is called on a Stream that was already canceled (stream.Canceled() true) because the remote endpoint aborted it — e.g. worker pool detected a dropped connection, the abort futures fired, or the connection was closed by the remote node.","commonSituations":"Remote ordering node crashed or restarted while the local node still held a stream to it; network partition; remote node too slow to drain consensus messages and its connection culled; TLS handshake failure mid-session aborting the stream.","solutions":["Check connectivity and health of the remote ordering node; restart it if it crashed","Verify TLS certificates and mutual auth between cluster members","Increase SendBufferSize / address remote slowness so streams are not aborted for being unable to keep up","Retry the send — the stream layer will establish a new stream on the next connection to the recovered node"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if stream.Canceled() { return fmt.Errorf(\"stream aborted: %s\", stream.AbortReason()) }","typeGuard":null,"tryCatchPattern":"err := stream.Send(consensusReq)\nif err != nil {\n    if strings.Contains(err.Error(), \"aborted\") {\n        // stream dead: reconnect and resend on a fresh stream\n        return reconnectAndResend(consensusReq)\n    }\n    return err\n}","preventionTips":["Monitor remote node health; streams abort when peers crash","Tune SendBufferSize so slow remotes aren't culled","Reconnect promptly on abort to minimize consensus downtime","Check TLS/network stability between cluster members"],"tags":["fabric","orderer","raft","grpc","stream"],"backgroundTag":"stream-aborted","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}