[#1605] node: Stream forwarder requests

Do not hold objects in memory in the forwarded Get/GetRange requests.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-07-15 09:55:53 +03:00 committed by fyrchik
parent 89ebc278b8
commit a421344727
2 changed files with 27 additions and 26 deletions

View file

@ -36,8 +36,14 @@ func (exec *execCtx) processNode(ctx context.Context, info client.NodeInfo) bool
case err == nil:
exec.status = statusOK
exec.err = nil
exec.collectedObject = obj
exec.writeCollectedObject()
// both object and err are nil only if the original
// request was forwarded to another node and the object
// has already been streamed to the requesting party
if obj != nil {
exec.collectedObject = obj
exec.writeCollectedObject()
}
case errors.As(err, &errRemoved):
exec.status = statusINHUMED
exec.err = errRemoved