Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Limit how much memory one plugin update may use

Đang mở
#304 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
linux, python
Lĩnh vực
backend, security

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ả

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.
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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của txoof/PaperPi

Tất cả issue của txoof/PaperPi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.