backport of commit ed204e0fd985bbb43da7e19e07cf541ad74284a8 (#18670)

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
This commit is contained in:
hc-github-team-nomad-core 2023-10-05 10:40:50 -05:00 committed by GitHub
parent 252515a84c
commit 88fd96daea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

3
.changelog/18662.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
client: prevent tasks from starting without the prestart hooks running
```

View File

@ -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