endpoint + zfs: context cancellation of util.IOCommand instances (send & recv for now)

This commit is contained in:
Christian Schwarz
2018-10-19 16:12:21 +02:00
parent ace4f3d892
commit 814fec60f0
3 changed files with 11 additions and 31 deletions

View File

@@ -89,7 +89,7 @@ func (p *Sender) Send(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, io.Rea
}
return &pdu.SendRes{ExpectedSize: expSize}, nil, nil
} else {
stream, err := zfs.ZFSSend(r.Filesystem, r.From, r.To, "")
stream, err := zfs.ZFSSend(ctx, r.Filesystem, r.From, r.To, "")
if err != nil {
return nil, nil, err
}
@@ -279,7 +279,7 @@ func (e *Receiver) Receive(ctx context.Context, req *pdu.ReceiveReq, sendStream
getLogger(ctx).Debug("start receive command")
if err := zfs.ZFSRecv(lp.ToString(), sendStream, args...); err != nil {
if err := zfs.ZFSRecv(ctx, lp.ToString(), sendStream, args...); err != nil {
getLogger(ctx).
WithError(err).
WithField("args", args).