Skip to content

Commit

Permalink
backport of commit ed204e0
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Oct 5, 2023
1 parent fd4a647 commit 3c95af6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/18662.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
client: prevent tasks from starting without the prestart hooks running
```
6 changes: 6 additions & 0 deletions client/allocrunner/taskrunner/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ MAIN:
goto RESTART
}

// Check for a terminal allocation once more before proceeding as the
// prestart hooks may have been skipped.
if tr.shouldShutdown() {
break MAIN
}

select {
case <-tr.killCtx.Done():
break MAIN
Expand Down

0 comments on commit 3c95af6

Please sign in to comment.