Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon/install: file-descriptors leakage #3962

Open
lucab opened this issue Aug 25, 2022 · 3 comments
Open

daemon/install: file-descriptors leakage #3962

lucab opened this issue Aug 25, 2022 · 3 comments
Labels

Comments

@lucab
Copy link
Contributor

lucab commented Aug 25, 2022

Host system details

# rpm-ostree status
State: idle
AutomaticUpdatesDriver: Zincati
  DriverState: active; periodically polling for updates (last checked Thu 2022-08-25 08:29:02 UTC)
Deployments:
● fedora:fedora/s390x/coreos/testing
                  Version: 36.20220806.2.0 (2022-08-08T16:10:51Z)
               BaseCommit: 2b52abcb312724e21b49f31d5270e3109aae4e9f79dbec00d9f3ce105bb19d21
             GPGSignature: Valid signature by 53DED2CB922D8B8D9E63FD18999F7CBF38AB71F4

Expected vs actual behavior

After a few rounds of looping rpm-ostree install foo && rpm-ostree cleanup -p, I'm seeing quite a few FDs that apparently leaked:

# ls -la /proc/<PID>/fd/
[...]
rwx------. 1 root root 64 Aug 25 08:22 361 -> 'socket:[136876]'
lrwx------. 1 root root 64 Aug 25 08:22 362 -> /sysroot/ostree/repo/.lock
lr-x------. 1 root root 64 Aug 25 08:22 363 -> /sysroot/ostree/repo
lr-x------. 1 root root 64 Aug 25 08:22 364 -> /sysroot/ostree/repo/objects
lr-x------. 1 root root 64 Aug 25 08:22 365 -> /sysroot/ostree/repo/tmp
lrwx------. 1 root root 64 Aug 25 08:22 366 -> /sysroot/ostree/repo/.lock
lr-x------. 1 root root 64 Aug 25 08:22 367 -> /sysroot/ostree/repo/tmp/cache
lrwx------. 1 root root 64 Aug 25 08:22 368 -> /sysroot/ostree/repo/.lock
lrwx------. 1 root root 64 Aug 25 08:22 369 -> 'socket:[138358]'
lr-x------. 1 root root 64 Aug 25 08:22 370 -> /sysroot/ostree/repo
lr-x------. 1 root root 64 Aug 25 08:22 371 -> /sysroot/ostree/repo/objects
lr-x------. 1 root root 64 Aug 25 08:22 372 -> /sysroot/ostree/repo/tmp
lr-x------. 1 root root 64 Aug 25 08:22 373 -> /sysroot/ostree/repo/tmp/cache
lrwx------. 1 root root 64 Aug 25 08:22 374 -> 'socket:[138375]'
lr-x------. 1 root root 64 Aug 25 08:22 375 -> /sysroot/ostree/repo
lr-x------. 1 root root 64 Aug 25 08:22 376 -> /sysroot/ostree/repo/objects
lr-x------. 1 root root 64 Aug 25 08:22 377 -> /sysroot/ostree/repo/tmp
lr-x------. 1 root root 64 Aug 25 08:22 378 -> /sysroot/ostree/repo/tmp/cache
lrwx------. 1 root root 64 Aug 25 08:22 380 -> /sysroot/ostree/repo/.lock
lrwx------. 1 root root 64 Aug 25 08:22 384 -> /sysroot/ostree/repo/.lock
lrwx------. 1 root root 64 Aug 25 08:22 386 -> /sysroot/ostree/repo/.lock
[...]

Not a big deal as eventually the daemon goes to idle and stops (or it can be stopped/restarted manually).
But this FDs leakage makes reproducing non-deterministic bugs a bit more cumbersome; the first time I tried it in a tight loop I encountered a weird forking error, which turned out to be a FD exhaustion.

@jlebon
Copy link
Member

jlebon commented Aug 25, 2022

This might've been fixed by ostreedev/ostree#2692.

@lucab
Copy link
Contributor Author

lucab commented Aug 25, 2022

Ah, very likely. Although it seems we are also leaking a socket FD. I'm not looking into this for the moment, but let's do another check when ostree 2022.6 is out.

@cgwalters
Copy link
Member

I'd still like eventually to fork off the transaction as a separate subprocess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants