Skip to content

cri: add file log type#13136

Open
ningmingxiao wants to merge 1 commit intocontainerd:mainfrom
ningmingxiao:file_io_type
Open

cri: add file log type#13136
ningmingxiao wants to merge 1 commit intocontainerd:mainfrom
ningmingxiao:file_io_type

Conversation

@ningmingxiao
Copy link
Copy Markdown
Contributor

@ningmingxiao ningmingxiao commented Mar 27, 2026

fix #11511
add containerd use less memory

+--------------------------------+      +-----------shim----------+   +--------CRI--------+
|                                |      |                         |   |                   |
| setns-process/stdout (pipe+w)----------->(pipe+r)---->(fifo+w)-------->(fifo+r)-->FILE  |
|                                |      |                         |   |                   |
+--------------------------------+      +-------------------------+   +-------------------+

shim write container log into file with k8s log format and I have to add a new reopen func to let shim reopen log when kubelet need to logroate logfile.

+--------------------------------+      +-----------shim----------+   
|                                |      |                         |   |                   |
| setns-process/stdout (pipe+w)----------->(pipe+r)---->FILE |
|                                |      |                         |   |                   |
+--------------------------------+      +-------------------------+   

after this pr containerd memory reduce more than 20% (200 pods)
If containerd is exited the container init process can keep printing stdout/stderr log,because shim consume pipe and write container's log into a file (with k8s log format) and the pipe never full @dmcgowan @mxpv @fuweid can you take a look ?

@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Mar 27, 2026
@ningmingxiao ningmingxiao marked this pull request as draft March 27, 2026 14:14
@dosubot dosubot Bot added area/cri Container Runtime Interface (CRI) kind/feature labels Mar 27, 2026
@ningmingxiao ningmingxiao force-pushed the file_io_type branch 3 times, most recently from 00e95b8 to 1279cc1 Compare March 27, 2026 15:22
@ningmingxiao ningmingxiao marked this pull request as ready for review April 4, 2026 14:29
@dosubot dosubot Bot added the area/runtime Runtime label Apr 4, 2026
@ningmingxiao ningmingxiao force-pushed the file_io_type branch 2 times, most recently from 53e4393 to 75ec738 Compare April 4, 2026 14:42
@ningmingxiao ningmingxiao marked this pull request as draft April 4, 2026 14:43
@ningmingxiao ningmingxiao force-pushed the file_io_type branch 6 times, most recently from b0befdf to 718b7ad Compare April 5, 2026 07:23
@ningmingxiao ningmingxiao marked this pull request as ready for review April 7, 2026 08:04
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) area/runtime Runtime kind/feature size/XXL

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

container hang at at pipe_write when containerd stop

2 participants