Skip to content

Conversation

@ningmingxiao
Copy link
Contributor

@ningmingxiao ningmingxiao commented Dec 12, 2024

@thaJeztah
try to fix this issue golang/go#14592

Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
@ningmingxiao ningmingxiao changed the title add LockOSThread to kill therad add LockOSThread to kill thread Dec 12, 2024
@thaJeztah
Copy link
Member

@ningmingxiao
Copy link
Contributor Author

containerd/containerd#11128 these pr will reduce the occurrence of bugs.

go func() {
if wg != nil {
defer wg.Done()
runtime.LockOSThread()
Copy link
Member

Choose a reason for hiding this comment

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

Well. Go runtime will create new thread if all existing threads are in kernel mode. The openAt syscall on fifo won't last too long in practise because kubelet always starts container after created containerd/containerd#11128.

I would like to wait for Go runtime to handle idle threads instead of using LockOSThread here, because it may cause unexpected issue. For example, in process X, sub-thread A invokes exec process Y with Pdeathsig: SIGKILL. If the sub-thread A is killed by LockOSThread, the process Y will be killed as well. It's hard to tell who sends signal to process Y in production. So, I am not a fan to use LockOSThread.

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.

3 participants