Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,21 @@ def get_delay(now, end):
def no_builds_between(start, end):
start = datetime.strptime(start, "%H:%M").time()
end = datetime.strptime(end, "%H:%M").time()
def f(builder, requests):
def canStartBuild(builder, wfb, request):
now = datetime.now().time()
if is_within_time_range(now, start, end):
delay = get_delay(now, end)
# Schedule the build later
deferred = defer.Deferred()
builder.master.reactor.callLater(
int(delay),
deferred.callback,
requests[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem is here, where the first element of requests is a "random" job that gets deferred.

)
return deferred
# Adapted from: https://docs.buildbot.net/current/manual/customization.html#canstartbuild-functions
wfb.worker.quarantine_timeout = delay
wfb.worker.putInQuarantine()
# This does not take the worker out of quarantine, it only resets
# the timeout value to default (restarting the default
# exponential backoff)
wfb.worker.resetQuarantine()
return False
# Schedule the build now
return requests[0]
return f
return True
return canStartBuild


github_status_builders = []
Expand Down Expand Up @@ -323,7 +323,7 @@ for branch_num, (git_url, branchname, git_branch) in enumerate(git_branches):
# This worker runs pyperformance at 12am. If a build is scheduled between
# 10pm and 2am, it will be delayed at 2am.
if worker_name == "diegorusso-aarch64-bigmem":
builder.nextBuild = no_builds_between("22:00", "2:00")
builder.canStartBuild = no_builds_between("22:00", "2:00")

c["builders"].append(builder)

Expand Down Expand Up @@ -392,7 +392,7 @@ for name, worker_name, buildfactory, stability, tier in BUILDERS:
# This worker runs pyperformance at 12am. If a build is scheduled between
# 10pm and 2am, it will be delayed at 2am.
if worker_name == "diegorusso-aarch64-bigmem":
builder.nextBuild = no_builds_between("22:00", "2:00")
builder.canStartBuild = no_builds_between("22:00", "2:00")

c["builders"].append(builder)

Expand Down