Limit how much memory one plugin update may use
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 32/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 205
- Fork
- 17
- Merge trung bình
- 4 giờ 8 phút
- Pull request đã merge (30 ngày)
- 72
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của txoof/PaperPi
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:plugins enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core enhancement hardware
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của txoof/PaperPi
Issue tương tự
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkCó thể đã có người làm @ocelotl đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cuga-project/cuga-agent#1020 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
microsoft/playwright#43640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày