Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Sven Anderson
Caleb Spare schrieb am Mi. 7. Juni 2023 um 19:22: > On Wed, Jun 7, 2023 at 2:33 AM Sven Anderson wrote: > > > > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment > newConns in parallel, so it may get corru

Re: [go-nuts] Why does sudog g field hold unsafe.Pointer?

2023-06-07 Thread Ian Lance Taylor
On Wed, Jun 7, 2023 at 5:13 AM 'Mikhail Gritsenko' via golang-nuts wrote: > > Why does sudog struct for elem field for the second node in sendq of a chan > hold unsafe.Pointer BUT the first node of the sendq holds actual value? Is it > somehow related with sendDirect or this is just an address o

Re: [go-nuts] How does golang handles DNS caching

2023-06-07 Thread Ian Lance Taylor
On Wed, Jun 7, 2023 at 5:13 AM Kishan Pandey wrote: > > My application is using gorm to connect to the database FQDN. If I am making > changes to DNS record for the FQDN , the application needs to be restarted to > take the DNS change. I think it is making the DNS query only at the > applicati

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Caleb Spare
On Wed, Jun 7, 2023 at 2:33 AM Sven Anderson wrote: > > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment newConns > in parallel, so it may get corrupted. Same for lines 39/40. > > You might claim, that fo

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Caleb Spare
On Wed, Jun 7, 2023 at 7:05 AM Ian Lance Taylor wrote: > > On Tue, Jun 6, 2023 at 4:31 PM Caleb Spare wrote: > > > > Can someone explain why the following test shows a race between the > > indicated lines? > > > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/http

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Ian Lance Taylor
On Tue, Jun 6, 2023 at 4:31 PM Caleb Spare wrote: > > Can someone explain why the following test shows a race between the > indicated lines? > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/httprace/httprace_test.go#L12-L43 > > The race seems to be triggered by th

[go-nuts] How does golang handles DNS caching

2023-06-07 Thread Kishan Pandey
My application is using gorm to connect to the database FQDN. If I am making changes to DNS record for the FQDN , the application needs to be restarted to take the DNS change. I think it is making the DNS query only at the application start time but not afterward. I would like to know how does

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread burak serdar
On Wed, Jun 7, 2023, 12:33 PM Sven Anderson wrote: > That’s not only a read/write race, it’s also a write/write race. Every > request to the server creates a new Go routine that might increment > newConns in parallel, so it may get corrupted. Same for lines 39/40. > The write/write race will hap

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread Sven Anderson
That’s not only a read/write race, it’s also a write/write race. Every request to the server creates a new Go routine that might increment newConns in parallel, so it may get corrupted. Same for lines 39/40. You might claim, that for infrastructural reasons, there can be no concurrent requests to

Re: [go-nuts] Hard-to-explain race detector report

2023-06-07 Thread burak serdar
On Tue, Jun 6, 2023 at 5:31 PM Caleb Spare wrote: > Can someone explain why the following test shows a race between the > indicated lines? > > > https://github.com/cespare/misc/blob/b2e201dfbe36504c88e521e02bc5d8fbb04a4532/httprace/httprace_test.go#L12-L43 > > The race seems to be triggered by t