Repository navigation
Description
Is your feature request related to a problem or challenge?
Recently we have been seeing the Merge Queue get stuck:
We enquired with ASF Infrastructure on INFRA-28374 and they told us the issue is that the ASF's GitHub Action queue is full which is why it is taking a long time to start jobs:
We are aware of a long term usage pattern whereby our limited number of
concurrent GitHub Actions jobs running on GitHub hosted runners is at 100%
utilisation most of the day most of the time. Thus, from time to time we
communicate to projects who utilise the most minutes to review their
workflows for efficiency improvements.At the moment, datafusion is the top consumer of GitHub Action minutes over
the last 7 days, and 3x the 10th in the list of minutes used.
Note the "datafusion" project as measured by ASF Infra includes all DataFusion subprojects (datafusion, datafusion-comet, datafusion-ballista, datafusion-python, etc.), so reducing usage may require a cross-repository effort.
Here is the report of our current usage (login required):
History
This is the second time we have been contacted by ASF Infra about GHA usage.
The first was in May 2026, when ASF Infra identified DataFusion as a top-5 consumer: #22455. After some tweaks, by June 2026, our usage dropped below the policy thresholds and DataFusion fell out of the top 5.
Useful resources
- ASF GitHub Actions policy (limits: 250,000 minutes / calendar week, 216,000 minutes / any 5-day window): https://infra.apache.org/github-actions-policy.html
- ASF usage report for the datafusion project (login required): https://infra-reports.apache.org/#ghactions&project=datafusion&hours=168&limit=15&group=name
- ASF Infra best-practices wiki page: https://cwiki.apache.org/confluence/spaces/INFRA/pages/430408443/GitHub+Actions+Recommended+Practices
- ASF Slack channel for sharing workflow optimisations across projects:
#project-workflow-optimisations
Related issues
- Reduce Github Action Usage #22455 (previous round of this same problem)
- [EPIC] A collection of items to improve developer / CI speed #13813
- Add Local Scripts to Reproduce Full CI #21048
- CI takes hours to start #25088 (CI takes hours to start — likely a symptom of pool saturation)
- Move Extended tests to the standard ones? #21241 (discussion of when extended tests should run)
- CI: count-distinct byte tests run for hours and hit the 360-minute limit #25011 (example of a runaway CI job: extended tests hitting the 360 minute limit)
Activity
alamb commentedon Sep 10, 2026
CI time breakdown by workflow
Breaking down the report screenshot above, DataFusion is as
Total usage: 336,347 minutes, or 33 full-time runners — over the ASF policy ceiling of 250,000 minutes / 25 full-time runners per calendar week.
Three workflows exceed 5% of total time, and together account for ~87% of all usage:
1. CI — 49.31% (~165,900 min)
apache/datafusion-comet2. Rust — 27.16% (~91,350 min)
apache/datafusionmain.3. Datafusion extended tests — 10.85% (~36,500 min)
apache/datafusionmain/branch-*and on every push to any PR touchingdatafusion/physical*,expr*,optimizer, orsql— a large fraction of all PRs.Everything else (< 2.5% each)
Observations
datafusionrepo now accounts for ~40%+ of usage itselfalamb commentedon Sep 10, 2026
FYI @blaginin
alamb commentedon Sep 10, 2026
Among other things the fact we have a merge queue and the jobs timeout likely exacerbates the problem (as each PR has to get put in the queue a few times rerunning CI each time)
alamb commentedon Sep 10, 2026
I also filed a ticket in Comet
comphead commentedon Sep 10, 2026
Thanks @alamb for tracking this. Comet got lots of contributions last month and that explains
comphead commentedon Sep 10, 2026
This ticket may also help DF CI #25092, very frequently the PR removed from MQ because of flaky MinIO tests
rluvaton commentedon Sep 10, 2026
Is it possible for Apple to chime in for datafusion and datafusion-comet a little?
Are we getting GitHub Actions minutes from GitHub or from Apache? because if this is from Apache, we might be better change to use Hetzner servers (which is what we are doing in my company)
comphead commentedon Sep 10, 2026
Organizational part is bumpy atm, we already tried that. Minutes come from GH actions that has been run using ASF shared resources.
alamb commentedon Sep 10, 2026
I believe the runners are provided by Github as an in-kind donation to the ASF
We could try and crowdsource additional runner minutes (the way arrow did with ursa computing, etc) but then someone has to manage / pay / coordinate for those resources
I think we shoudl try and reduce runner usage first, and then if we are still having problems figure out a way to get more resources
adriangb commentedon Sep 10, 2026
Could we have someone (e.g. Apple, probably needs to be someone w/ a big AWS account) run
runs-onrunners in their AWS account and we coordinate GitHub App installation / auth w/ ASF Infra? Then the AWS account (and it's bill) would be long to whoever is funding it and there would be no need to coordinate payment (which I understand can be the hard part).comphead commentedon Sep 10, 2026
Another option which works for Apache Spark and tested in Comet as well is running CI on the contributor forks apache/datafusion-comet#4570
It changes the model and also contributor machines are 20-30% slower than ASF but the benefit is ASF resource pool is being used much more considerate. This might be later option, but taking into account DF ecosystem is growing and take more resources we might think of it
AdamGS commentedon Sep 11, 2026
I think some of the benefit of runs-on is limited by the fact that a lot of contributors open PRs from forks, so the
varscontext is empty (or coming from the fork repo) and we still use the slow gh-provided runners.blaginin commentedon Sep 11, 2026
so when you open pr from the fork, the base repo still runs them on the head repo infra. it can be runs-on in DF's case - but i had to disable it in a bunch of places because of costs...
blaginin commentedon Sep 11, 2026
that seems super reasonable
26 remaining items
kumarUjjawal commentedon Sep 22, 2026
Although the recent numbers for the last 7 days are withing the ASF policy boundary (limits: 250,000 minutes / calendar week, 216,000 minutes / any 5-day window). I feel if datafusion continue to see new contributors and the PR volumes keep increasing, we will pass the limit again, that's why I think the fork pr job runs are the way to go forward so we don't have to deal with this again.
I have opened a pr for that: #25591
ci: cache dependencies for feature checks (apache#25231)
ci: share workspace check artifacts with feature checks (apache#25249)
ci: skip queue-verified Rust jobs on pushes to main (apache#25365)
ci: skip queue-verified Dev and Dependencies jobs on pushes to main (a…
chore(ci): Register the substrait check job with runs-on, route spark…
chore: Move more CI jobs to run on `ubuntu-slim` (apache#26571)
chore: run the circular dependency check on the fork for fork PRs (ap…
chore: Skip `datafusion-sqllogictest` in semver check (apache#26577)
chore: check for circular dependencies with `cargo publish` (apache#2…
chore: skip slow test under `force_hash_collisions` (apache#26594)
kumarUjjawal commentedon Oct 27, 2026
Rollout plan for merge queue cleanup (#26760)
#26760 adds the Merge queue cleanup workflow. The workflow finds unfinished merge queue runs whose queue branch was removed or now points to a different commit. After the merge, the workflow only reports candidates. It does not cancel runs until a maintainer enables it.
1. Observe for at least one week
MERGE_QUEUE_CLEANUP_ENABLED.2. Check the results before enabling cancellation
merge_groupscan finds candidates. If it almost never finds any, remove themerge_grouptrigger and keep the 15-minute schedule.Dry runs measure detection only. They do not measure cancellation latency or runner shutdown cost.
3. Enable cancellation
MERGE_QUEUE_CLEANUP_ENABLEDtotrue.runs-oninstance that is already starting. This decides how much of the estimated saving is real.merge_groupscan cancel the same run at the same time. Count how often this happens.4. Stop cancellation
false.alamb commentedon Oct 27, 2026
Thanks @kumarUjjawal -- this sounds like a good plan to me 🙏
ci: cancel obsolete merge queue runs (apache#26760)
ci: Skip macOS tests in forks (apache#27017)