[Bug]: ManagedOOMPreference=avoid in t3code.service puts systemd --user into a 100% CPU loop with uresourced (Fedora/GNOME)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 69/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- linux, typescript
Hướng nghiên cứu
Bắt đầu tại apps/server/src/cloud/bootService.ts và đọc mẫu unit, đặc biệt là cài đặt ManagedOOMPreference=avoid cùng chú thích gần đó. Kiểm tra mối liên hệ giữa mẫu này với vòng lặp phản hồi đã được báo cáo và các phạm vi hiện có theo từng agent. Hoàn thành khi dịch vụ đã cài đặt không còn kích hoạt vòng lặp CPU được mô tả mà vẫn giữ được cơ chế bảo vệ dự kiến; hãy xác minh hành vi của unit trên Fedora/GNOME với uresourced 0.5.4.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Fedora 44 Workstation (GNOME), which ships and enables
uresourced --user0.5.4. - Install the background service with a build that includes #17662 (any nightly since 2026-10-10, or v0.1.0):
t3 service install. - Leave it running. At some point (in my case within a day of installing),
systemd --usergoes to ~100% CPU and stays there.
Expected behavior
The t3code.service unit doesn't cause any ongoing work in the user manager once it's running.
Actual behavior
systemd --user pins a core indefinitely, and uresourced --user sits at ~13–15%. On my machine this has run for about 6 days: the user manager has accumulated 5d18h of CPU time.
The unit template in apps/server/src/cloud/bootService.ts (added in #17662, still on main @ 133f57a832) sets ManagedOOMPreference=avoid, and that sets up a feedback loop with uresourced:
- Because of
ManagedOOMPreference=avoid, systemd sets theuser.oomd_avoidxattr on thet3code.servicecgroup, and re-applies it whenever the unit's properties change. - Each xattr write is an
IN_ATTRIBevent on the cgroup directory. uresourced watchesapp.slicecgroups forIN_ATTRIBand responds withSetUnitProperties(t3code.service, CPUWeight=100, IOWeight=100). - That property change re-applies the xattr, so step 1 happens again, forever.
Measured on a live system:
- ~2,500
IN_ATTRIBevents/sec onapp.slice/t3code.service, and zero on any other cgroup inapp.slice. - ~1,900
SetUnitPropertiescalls/sec fromuresourced --userto the user manager, all fort3code.service, allCPUWeight=100 IOWeight=100.
This is a uresourced bug at heart. It was reported in benzea/uresourced#9, where the reporter also had ManagedOOMPreference=avoid on the affected units, and fixed upstream in b9bf446 (2026-09-20, "avoid reconfiguring units with the same value"). That fix isn't in any tagged release, so Fedora's 0.5.4 still loops. Until distros pick it up, any T3 service install on Fedora/GNOME is exposed.
Side effect: uresourced keeps resetting the weights to 100, so the unit's CPUWeight=1000 / IOWeight=1000 never actually take effect on these systems.
Suggested fix: drop ManagedOOMPreference=avoid from the unit. The comment above it already notes that oomd ignores it on typical distros (oomd watches user-1000.slice, which root owns), and per #17662 the per-agent scopes are what actually protect the server. An alternative is to only emit it when the monitored cgroup is user-owned.
Impact
Major degradation or frequent failure
Version or commit
v0.1.0 (also every nightly since 0.0.46-nightly.20261010); unit template unchanged on main @ 133f57a832
Environment
Fedora 44 (kernel 7.2.5-200.fc44), systemd 259.9-1.fc44, uresourced 0.5.4-5.fc44, GNOME on Wayland
Logs or stack traces
$ top -b -n1 -p 1725,1058839
1725 brian 20 0 28512 15256 10112 R 99.7 0.0 5d+18h systemd
1058839 brian 20 0 382620 9360 8648 S 14.9 0.0 18,40 uresourced
$ getfattr -d -m - /sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/app.slice/t3code.service
user.oomd_avoid="1"
$ busctl --user monitor (3s, counted)
5665 Member=SetUnitProperties # all from :1.21220 = /usr/libexec/uresourced --user
Sender=:1.21220 Destination=:1.1 Path=/org/freedesktop/systemd1 Interface=org.freedesktop.systemd1.Manager Member=SetUnitProperties
MESSAGE "sba(sv)" {
STRING "t3code.service";
BOOLEAN true;
ARRAY "(sv)" {
STRUCT "sv" { STRING "CPUWeight"; VARIANT "t" { UINT64 100; }; };
STRUCT "sv" { STRING "IOWeight"; VARIANT "t" { UINT64 100; }; };
};
};
# inotify IN_ATTRIB on app.slice for 2s
{'t3code.service': 5088}
Workaround
Either of:
- Override the setting with a drop-in, then
systemctl --user daemon-reload:# ~/.config/systemd/user/t3code.service.d/no-oomd-avoid.conf [Service] ManagedOOMPreference=none - Or disable uresourced for the user:
systemctl --user mask --now uresourced.
If the user manager is already wedged, systemctl --user daemon-reexec breaks the loop without stopping running services (from uresourced#9).
- Ngôn ngữ chính
- TypeScript
- Star
- 24.8k
- Fork
- 6.4k
- Merge trung bình
- 3 giờ 39 phút
- Pull request đã merge (30 ngày)
- 301
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọ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 pingdotgg/t3code
-
bug needs-triage
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
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 72/100
pingdotgg/t3code#22819 · 2 bình luận ·
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 77/100
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 66/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pingdotgg/t3code
Issue tương tự
-
ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
xavxyz/bei-shan-lin-shui#57 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] rag: sentence content can cross the reported sentence boundariesCó thể đã có người làm @LJK-ikun đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 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
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
platformatic/mcp#361 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
最近文档这个弹窗,左右宽度没有最小宽度限制Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
siyuan-note/siyuan#20799 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày