diff options
author | Valery Piashchynski <[email protected]> | 2021-06-03 14:54:06 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-03 14:54:06 +0300 |
commit | 62bbde7936109d18bf1f727974719804dad4c105 (patch) | |
tree | 54fb8493840837294bbe84ba5e1d7663ed027cad /pkg/worker/worker.go | |
parent | 9c01e7ab1548e1416598b702d63866fa6dc5707b (diff) |
- Do not write an error into the responseWriter if this is internal
error
- Handle SoftJob error
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/worker/worker.go')
-rwxr-xr-x | pkg/worker/worker.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index 69c438b0..2044d0e7 100755 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -181,12 +181,13 @@ func (w *Process) closeRelay() error { // Stop sends soft termination command to the Process and waits for process completion. func (w *Process) Stop() error { - var err error + const op = errors.Op("process_stop") w.state.Set(StateStopping) - err = multierr.Append(err, internal.SendControl(w.relay, &internal.StopCommand{Stop: true})) + err := internal.SendControl(w.relay, &internal.StopCommand{Stop: true}) if err != nil { w.state.Set(StateKilling) - return multierr.Append(err, w.cmd.Process.Signal(os.Kill)) + _ = w.cmd.Process.Signal(os.Kill) + return errors.E(op, errors.Network, err) } w.state.Set(StateStopped) return nil |