Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-02 Thread TheDiveO
I've created https://github.com/golang/go/issues/53210 and the answer is already in! The initial thread m0 is actually handled differently in that it doesn't get terminated but, to use the runtime terminology, "wedged". Now this explains what I'm seeing in production, because by some chance m0

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-02 Thread Ian Lance Taylor
On Thu, Jun 2, 2022 at 9:21 AM TheDiveO wrote: > > On Thursday, June 2, 2022 at 5:48:18 PM UTC+2 Ian Lance Taylor wrote: >> >> Can you point to any documentation about the problem. Earlier you >> mentioned that there was something in the procfs man page. I didn't >> see it, but as the procfs man p

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-02 Thread TheDiveO
Hi Ian, On Thursday, June 2, 2022 at 5:48:18 PM UTC+2 Ian Lance Taylor wrote: > Can you point to any documentation about the problem. Earlier you > mentioned that there was something in the procfs man page. I didn't > see it, but as the procfs man page is very large I'm sure I just > missed i

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-02 Thread Ian Lance Taylor
On Thu, Jun 2, 2022 at 6:20 AM TheDiveO wrote: > > On Thursday, June 2, 2022 at 3:03:17 AM UTC+2 Ian Lance Taylor wrote: >> >> On Wed, Jun 1, 2022 at 10:45 AM TheDiveO wrote: >> > What now? Terminating T0 doesn't look like a great idea at second look: >> > for instance, as I mentioned above, this

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-02 Thread TheDiveO
Hi Ian, On Thursday, June 2, 2022 at 3:03:17 AM UTC+2 Ian Lance Taylor wrote: > On Wed, Jun 1, 2022 at 10:45 AM TheDiveO wrote: > > What now? Terminating T0 doesn't look like a great idea at second look: > for instance, as I mentioned above, this causes some problems further down > the road, s

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-01 Thread Ian Lance Taylor
On Wed, Jun 1, 2022 at 10:45 AM TheDiveO wrote: > > While exploring more of the proc.go code I noticed that my original question > somehow didn't fully reflect what I'm wondering about: what happens in the > following situation...? Are all tasks/threads really equal? > > a non-main G42 goroutine

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-06-01 Thread TheDiveO
While exploring more of the proc.go code I noticed that my original question somehow didn't fully reflect what I'm wondering about: what happens in the following situation...? Are all tasks/threads really equal? - a non-main G42 goroutine gets scheduled onto the main thread/leader task, w

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread TheDiveO
Ian, thank you very much! Found it and am now trying to somehow get my head around it! On Thursday, May 26, 2022 at 9:46:26 PM UTC+2 Ian Lance Taylor wrote: > On Thu, May 26, 2022 at 12:08 PM TheDiveO wrote: > > > > > On Thursday, May 26, 2022 at 8:51:49 PM UTC+2 Ian Lance Taylor wrote: > >> >

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread Ian Lance Taylor
On Thu, May 26, 2022 at 12:08 PM TheDiveO wrote: > > On Thursday, May 26, 2022 at 8:51:49 PM UTC+2 Ian Lance Taylor wrote: >> >> If the scheduler is running on a goroutine locked using >> runtime.LockOSThread and needs to start a new thread, it does so by >> asking a template thread to create it.

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread TheDiveO
On Thursday, May 26, 2022 at 8:51:49 PM UTC+2 Ian Lance Taylor wrote: > If the scheduler is running on a goroutine locked using > runtime.LockOSThread and needs to start a new thread, it does so by > asking a template thread to create it. The template thread doesn't do > anything other than cr

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread Ian Lance Taylor
On Thu, May 26, 2022 at 11:17 AM TheDiveO wrote: > > On Thursday, May 26, 2022 at 7:39:10 PM UTC+2 Ian Lance Taylor wrote: >> >> > But what about T0? Wouldn't throwing away T0 terminate the whole program >> > ... which doesn't seem to be the case? Or am I mistaken here? >> >> Once you've created

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread TheDiveO
On Thursday, May 26, 2022 at 7:39:10 PM UTC+2 Ian Lance Taylor wrote: > > But what about T0? Wouldn't throwing away T0 terminate the whole program > ... which doesn't seem to be the case? Or am I mistaken here? > > Once you've created multiple threads in a process, the original thread > (what y

Re: [go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread Ian Lance Taylor
On Thu, May 26, 2022 at 10:34 AM TheDiveO wrote: > > Even after some research I couldn't find -- or stupidly missed -- what > happens in this case; I suspect this to "somehow" be the underlaying cause of > some of my applications ending up with their main OS-level thread sitting in > the wrong

[go-nuts] LockOSThread, switching (Linux kernel) namespaces: what happens to the main thread...?

2022-05-26 Thread TheDiveO
Even after some research I couldn't find -- or stupidly missed -- what happens in this case; I suspect this to "somehow" be the underlaying cause of some of my applications ending up with their main OS-level thread sitting in the wrong network namespace albeit I made sure to ditch all OS-level