Skip to content

Conversation

ningmingxiao
Copy link
Contributor

@ningmingxiao ningmingxiao commented Aug 19, 2025

nerdctl old version call task.Wait to wait container stop, but if containerd stop task.Wait will return. So I find a better way to solve this we can let nerdctl call shim api to get container status.

@ningmingxiao ningmingxiao force-pushed the live_restore branch 3 times, most recently from 36e64b2 to 0801fee Compare August 19, 2025 12:29
@ningmingxiao ningmingxiao force-pushed the live_restore branch 6 times, most recently from d11a608 to f4c0f71 Compare August 19, 2025 14:37
@ningmingxiao ningmingxiao force-pushed the live_restore branch 5 times, most recently from 8b9cb17 to b3ef6e5 Compare August 20, 2025 01:20
Copy link
Member

Choose a reason for hiding this comment

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

What about non-linux unix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to connect unix shim or windows shim, does containerd-shim-runc-v2 works well on unix? @AkihiroSuda

Copy link
Contributor Author

@ningmingxiao ningmingxiao Aug 21, 2025

Choose a reason for hiding this comment

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

	config := &Config{
		ID:        os.Getenv("CONTAINER_ID"),
		Namespace: os.Getenv("CONTAINER_NAMESPACE"),
		Stdout:    os.NewFile(3, "CONTAINER_STDOUT"),
		Stderr:    os.NewFile(4, "CONTAINER_STDERR"),
	}

I'm trying to find a way to avoid call task.Wait or call shim api.
if container main process exited. the pipe reader should know the writer is closed. but I can't find a good way to know pipe writer is closed. @AkihiroSuda

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try get EPOLLHUP event but it doesn’t work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

another way is to monitor /proc/container_pid to know container exited.

Signed-off-by: ningmingxiao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants