Hi,

On 2022-11-19 16:12:24 +1300, Thomas Munro wrote:
> Is there a way to find out about new git commits that is more
> efficient and timely than running N git fetches or whatever every
> minute in a cron job?  Maybe some kind of long polling where you send
> an HTTP request that says "I think the tips of branches x, y, z are at
> 111, 222, 333" and the server responds when that ceases to be true?

I think a git fetch is actually ok for that - it doesn't take a whole lot of
resources. However run_builds.pl is more heavyweight. For one, it starts one
run_build.pl for each branch, which each then fetches from git separately. But
more importantly, each run_build.pl seems to actually do a fair bit of work
before discovering nothing has changed.

A typical log I see:

Nov 20 06:08:17 bf-valgrind-v4 run_branches.pl[3289916]: Sun Nov 20 06:08:17 
2022: buildfarm run for grassquit:REL_14_STABLE starting
Nov 20 06:08:17 bf-valgrind-v4 run_branches.pl[3289916]: 
grassquit:REL_14_STABLE [06:08:17] checking out source ...
Nov 20 06:08:20 bf-valgrind-v4 run_branches.pl[3289916]: 
grassquit:REL_14_STABLE [06:08:20] checking if build run needed ...
Nov 20 06:08:20 bf-valgrind-v4 run_branches.pl[3289916]: 
grassquit:REL_14_STABLE [06:08:20] No build required: last status = Sat Nov 19 
23:54:38 2022 GMT, cur>

So we spend three seconds in the "checking out source" stage, just to then see
that nothing has actually changed.

Greetings,

Andres Freund


Reply via email to