Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Tree builds endpoint exhausts memory and took production down

オープン
#2,202 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@felipebergamin がすでに取り組んでいます。

2026年10月28日 から。

  • #2206 @felipebergamin による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
azure, django, nginx, postgresql, python

調査の方向性

Start with backend/kernelCI_app/queries/tree.py and treeDetailsBuildsView._sanitize_rows; trace how the builds endpoint fetches and filters rows, then compare that with the response fields it uses. The issue identifies filtering in SQL, selecting fewer columns, and bounding or paginating results as the proper fix; done means large tree requests no longer exhaust backend memory and the endpoint can be re-enabled.

索引モデルが issue の本文から書いたものです。

説明

bug URGENT

Summary

GET /api/tree/<tree>/<branch>/<commit_hash>/builds exhausts backend memory on large trees and took production down on 2026-10-27 (dashboard.kernelci.org and staging, ~21:50–22:17 UTC). The VM had to be hard-restarted.

Why this is an emergency

  • Production and staging share one 8 GB VM. One heavy request on this endpoint can freeze the whole host: web, API and SSH all become unreachable.
  • It is not load-related. Normal browsing of a linux-next commit page is enough, so it will happen again.
  • It has been happening for days: serial console shows repeated OOM kills of gunicorn workers at 1–2 GB RSS each, the latest ~5 days before this outage.

Evidence

  • Azure metrics: available memory 4.6 GB → 1.3 GB at 18:26 UTC (never freed). At 21:48, ~360 MB in from DB and CPU 90%. By 21:51, 70 MB free, disk reads pinned at 132 MB/s (thrashing). CPU credits were full, so this is not throttling.
  • The last API request completed at 21:48:21, after which the host was unresponsive.
  • nginx, 2026-10-27: 49 client aborts (499) on this endpoint: next/master ×28, android14-6.1-lts ×12, stable-rc/linux-5.10.y ×8. The 18:26 memory drop coincides with a 499 on /api/tree/next/master/<sha>/builds.

Root cause

get_tree_data(data_type="builds") (backend/kernelCI_app/queries/tree.py):

  • joins builds × incidents × issues for the checkout;
  • selects large text columns (misc, comment, command, log_url);
  • fetchall()s everything, then applies filter_* params in Python (treeDetailsBuildsView._sanitize_rows).

On top of that, gunicorn has 5 workers per backend × 2 backends, no --max-requests, no container memory limit and a 250 s timeout. Workers keep working after the client disconnects and never release memory.

Fix

  1. Immediate workaround: disable the endpoint (503), recycle workers, cap backend memory. Must be merged and deployed within 24 h.
  2. Proper fix: push filters into SQL, select only the columns the response needs, bound or paginate the result, then re-enable the endpoint.
  3. Follow-up: move staging off the production host (as was discussed on meetings), or we might make it on-demand
主要言語
Python
スター
10
フォーク
32
平均マージ
4日 7分
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kernelci/dashboard のほかの issue

kernelci/dashboard の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。