swarm-builder: refuse a build that waited too long for the slot
A request that waits behind another build, e.g. one a controller restart orphaned, could start a full build after most of the controller's 61-minute reply deadline was gone. The builder now waits at most REPLY_DEADLINE - BUILD_DEADLINE - 30 s for the slot and answers Failed, without building, past that. The 30 s covers the forge token read, now bounded to 20 s, and the reply's trip back. Fixes #5437
This commit is contained in:
parent
6630a51022
commit
bf848ba65f
4 changed files with 180 additions and 22 deletions
|
|
@ -22,7 +22,9 @@ pub const QUEUE_GROUP: &str = "builder";
|
|||
pub const BUILD_DEADLINE: Duration = Duration::from_hours(1);
|
||||
|
||||
/// How long the controller waits for the reply, and the queue lets the
|
||||
/// builder answer: the build at its deadline, plus a minute for the rest.
|
||||
/// builder answer: the build at its deadline, plus a minute the builder spends
|
||||
/// on a request's wait for the build slot, the forge token read before the
|
||||
/// build and the reply's trip back.
|
||||
pub const REPLY_DEADLINE: Duration = Duration::from_mins(61);
|
||||
|
||||
/// One build: an agent's config repo at one commit, on the builder's own
|
||||
|
|
|
|||
Loading…
Reference in a new issue