summaryrefslogtreecommitdiff
path: root/pkg/worker/sync_worker.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-14 17:22:49 +0300
committerGitHub <[email protected]>2021-07-14 17:22:49 +0300
commitcea3f6ab9faf80637dd23f6b1ca57c0b3309d98e (patch)
treec70b7058e1682e93e98c9cf006d3584351d73d3b /pkg/worker/sync_worker.go
parent9d018f259b45be9268ae85e089a07f25de894f41 (diff)
parentcb28ad07fadb78e2e77e485cd9b96abeddbf3a5c (diff)
#749 bug(supervisor, ttl): worker gets into the inconsistent state after TTL was reached
#749 bug(supervisor, ttl): worker gets into the inconsistent state after TTL was reached
Diffstat (limited to 'pkg/worker/sync_worker.go')
-rwxr-xr-xpkg/worker/sync_worker.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/worker/sync_worker.go b/pkg/worker/sync_worker.go
index 84ff5977..02f11d0b 100755
--- a/pkg/worker/sync_worker.go
+++ b/pkg/worker/sync_worker.go
@@ -60,6 +60,13 @@ func (tw *SyncWorkerImpl) Exec(p payload.Payload) (payload.Payload, error) {
return payload.Payload{}, errors.E(op, err)
}
+ // supervisor may set state of the worker during the work
+ // in this case we should not re-write the worker state
+ if tw.process.State().Value() != StateWorking {
+ tw.process.State().RegisterExec()
+ return rsp, nil
+ }
+
tw.process.State().Set(StateReady)
tw.process.State().RegisterExec()