Skip to content
New issue

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

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

Already on GitHub? # to your account

main_process: close the channel receivers. #1936

Merged
merged 1 commit into from
May 17, 2023

Conversation

ipuustin
Copy link
Contributor

It looks like libcontainer (at least when used from runwasi) is leaking three FDs for every container creation. This becomes a problem in Wasm use cases, where a single process may spawn a large number of Wasm containers. The lsof output looks like this:

...

container 364412 root  649u  unix 0x00000000ff880cf0       0t0  3539568 type=SEQPACKET (CONNECTED)
container 364412 root  650u  unix 0x000000003b11c72f       0t0  3537567 type=SEQPACKET (CONNECTED)
container 364412 root  651u  unix 0x0000000059949a57       0t0  3539570 type=SEQPACKET (CONNECTED)
container 364412 root  652u  unix 0x00000000c24f282c       0t0  3527349 type=SEQPACKET (CONNECTED)
container 364412 root  653u  unix 0x000000004a43cc7c       0t0  3537576 type=SEQPACKET (CONNECTED)
container 364412 root  654u  unix 0x000000004e420b32       0t0  3527351 type=SEQPACKET (CONNECTED)
container 364412 root  655u  unix 0x00000000c8e66c94       0t0  3537569 type=SEQPACKET (CONNECTED)
container 364412 root  656u  unix 0x00000000e91c2358       0t0  3537586 type=SEQPACKET (CONNECTED)
container 364412 root  657u  unix 0x000000006fc2e3b2       0t0  3537571 type=SEQPACKET (CONNECTED)
container 364412 root  658u  unix 0x000000001834ff2e       0t0  3537578 type=SEQPACKET (CONNECTED)
container 364412 root  659u  unix 0x00000000f0765edf       0t0  3537595 type=SEQPACKET (CONNECTED)
container 364412 root  660u  unix 0x000000004c210c5b       0t0  3537580 type=SEQPACKET (CONNECTED)
container 364412 root  661u  unix 0x0000000079f6e005       0t0  3537588 type=SEQPACKET (CONNECTED)
container 364412 root  662u  unix 0x00000000d5be89be       0t0  3539578 type=SEQPACKET (CONNECTED)
container 364412 root  663u  unix 0x000000003dc2d14f       0t0  3537590 type=SEQPACKET (CONNECTED)
container 364412 root  664u  unix 0x00000000d71d68b7       0t0  3537597 type=SEQPACKET (CONNECTED)
container 364412 root  665u  unix 0x00000000666f45e0       0t0  3539586 type=SEQPACKET (CONNECTED)
container 364412 root  666u  unix 0x000000007db0b87d       0t0  3537599 type=SEQPACKET (CONNECTED)
container 364412 root  667u  unix 0x00000000822c2187       0t0  3539580 type=SEQPACKET (CONNECTED)
container 364412 root  668u  unix 0x00000000a6ce888a       0t0  3539595 type=SEQPACKET (CONNECTED)
container 364412 root  669u  unix 0x0000000074afe56b       0t0  3539582 type=SEQPACKET (CONNECTED)
container 364412 root  670u  unix 0x0000000058dfe294       0t0  3539588 type=SEQPACKET (CONNECTED)
container 364412 root  671u  unix 0x0000000053a89328       0t0  3539604 type=SEQPACKET (CONNECTED)
container 364412 root  672u  unix 0x0000000049ce8f4b       0t0  3539590 type=SEQPACKET (CONNECTED)
...

This PR closes the receiving ends for the Youki sockets. The number of open sockets goes down and I'm able to run over a thousand containers from one process. I'm not familiar enough with Youki to be certain that this doesn't have any side effects, though.

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:10000:

@utam0k utam0k merged commit 271640b into youki-dev:main May 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants