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

Limit how much memory one plugin update may use

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

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

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
32/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
linux, python
領域
backend, security

調査の方向性

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 の本文から書いたものです。

説明

area:core needs-decision

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_AS counts all memory the process reserves, RLIMIT_DATA only its data).
  • A default for every plugin (for example 300 MB), a plugin can suggest more in its Plugin(...) (like storage_mb), and the user can change it per plugin (like time_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= in paperpi.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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

txoof/PaperPi のほかの issue

txoof/PaperPi の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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