Limit how much memory one plugin update may use
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 32/100
調査の方向性
Start with src/paperpi/runner.py and install/paperpi.service, then read how plugin processes receive their time limits and per-plugin settings. The issue leaves the memory limit, whether users can configure it, and whether to limit the whole service undecided; first resolve those choices and measure current plugins, including on a Pi 3. Done means plugin memory exhaustion is reported as a failed update without disrupting other plugins, with the agreed limits covering the listed helper processes and Library pictures.
索引モデルが issue の本文から書いたものです。
説明
Problem
Each plugin update runs in its own process with a time limit (60 s), but with no memory limit. Neither src/paperpi/runner.py nor install/paperpi.service sets one. A plugin that uses too much memory can fill the Pi's memory before its time runs out. The Pi then slows down while it moves memory to the SD card (swap), or Linux stops a process it picks itself, which may be PaperPi or the web interface instead of the plugin.
Found in the security review of ical_calendar (#302, comment on the PR), measured on the Pi 4 (1.8 GB):
- one invitation repeating every second (
RRULE:FREQ=SECONDLY) for 7 days: about 690,000 events, over 1 GB; the 60 s limit stopped it at about 500 MB (the plugin now leaves such events out); - a 5 MB calendar file: 376 MB while reading it.
Other plugins could do the same: large images (slideshow, comics), large JSON answers, a bug in a loop. A Pi 3 has only 1 GB.
Idea
- Give each plugin process a memory limit, set in the new process before the plugin is imported (for example with Python's
resource.setrlimit;RLIMIT_AScounts all memory the process reserves,RLIMIT_DATAonly its data). - A default for every plugin (for example 300 MB), a plugin can suggest more in its
Plugin(...)(likestorage_mb), and the user can change it per plugin (liketime_limit). - Going over the limit counts as a failed update with a plain message ("used more than 300 MB of memory"), the same as going over the time limit, so the other plugins keep working.
- Maybe also
MemoryMax=inpaperpi.service, so all of PaperPi together can't take the whole Pi.
To decide (txoof)
- The default limit, and whether the user may change it.
- Whether the systemd limit for the whole service is wanted too.
To check while building
- How much memory each current plugin really uses (some reserve more than they use, e.g. image libraries), so the default doesn't break any of them; also on a Pi 3.
- That the limit also covers the setting helpers' search processes and the Library pictures, which run the same way.
- 主要言語
- Python
- スター
- 205
- フォーク
- 17
- 平均マージ
- 4時間 8分
- マージ済み PR(30日)
- 72
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
txoof/PaperPi のほかの issue
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:plugins enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
area:core enhancement hardware
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free対応中かも @Aaqibhafeezkhan が今日担当しました。 オープンbeginner documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BistaDinesh03/critique#164 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug IO
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MrNeRF/LichtFeld-Studio#3824 ·
メンテナーはふだん 1 日以内に返信
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-webui/open-webui#33200 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check対応中かも @ocelotl が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-python#5825 ·
メンテナーはふだん 2 日以内に返信