Run a verb from the controller's own running image, and refuse what it cannot run as a handover (hq issue 289)
The witness moves a running build aside into a directory the controller's user cannot enter, then deletes it; a verb exec'd from os.Executable() in that window failed with permission denied. /proc/self/exe stays valid while the process lives. A verb that still cannot start, or arrives while the controller stops, is refused with link.ErrHandingOver and marked retry: handing-over.
This commit is contained in:
@@ -128,6 +128,10 @@ func serve(ctx context.Context) (err error) {
|
||||
stopActing()
|
||||
case <-ctx.Done():
|
||||
}
|
||||
// Stopping, whichever way: a verb arriving from here is refused as a handover, so its caller
|
||||
// asks the controller after this one rather than have a command started and killed with this
|
||||
// process (novox/hq issue 289).
|
||||
handingOver.Store(true)
|
||||
}()
|
||||
defer func() {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user