Backport of Retain task states for post stop tasks at the time of node GC into release/1.6.x (#18033)
This pull request was automerged via backport-assistant
This commit is contained in:
parent
95e71a82a4
commit
02c2f1a50f
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
client: Fixed a bug where the state of poststop tasks could be corrupted by client gc
|
||||
```
|
|
@ -734,6 +734,19 @@ func (ar *allocRunner) killTasks() map[string]*structs.TaskState {
|
|||
}
|
||||
wg.Wait()
|
||||
|
||||
// Perform no action on post stop tasks, but retain their states if they exist. This
|
||||
// commonly happens at the time of alloc GC from the client node.
|
||||
for name, tr := range ar.tasks {
|
||||
if !tr.IsPoststopTask() {
|
||||
continue
|
||||
}
|
||||
|
||||
state := tr.TaskState()
|
||||
if state != nil {
|
||||
states[name] = state
|
||||
}
|
||||
}
|
||||
|
||||
return states
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue