Re: [go-nuts] Go routine context

2022-10-01 Thread 'Axel Wagner' via golang-nuts
I have now read JEP 429 Extent-local variables (ELV) , which is probably the most salient for the discussion about context.Context. ELV allow to "bind" values a variable in a way that is local to a (virtual) thread. Those values are AIUI not always inherited to child

[go-nuts] Re: Encrypting credentials config file in production and pseudo key rotation

2022-10-01 Thread Peter Galbavy
We have a different requirement, which is opaquing of credentials in user visible config files. The company I work for has a basic way of doing this in the "real" product and I followed the same model for compatibility. There is, as yet, no auto rotation. Basically, we generate an OpenSSL "comp

[go-nuts] Re: Go routine context

2022-10-01 Thread Juliusz Chroboczek
> Very interesting article came out recently. > https://www.infoq.com/articles/java-virtual-threads/ Interesting article, thanks for the pointer. > it has implications for the Go context discussion and the author makes > a very good case as to why using the thread local to hold the > context - ra

Re: [go-nuts] Go routine context

2022-10-01 Thread Ian Lance Taylor
On Fri, Sep 30, 2022 at 11:47 PM 'Axel Wagner' via golang-nuts wrote: > > Note that TLS (or GLS) and similar primitives *are* periodically talked about > and I don't think it is categorically excluded to at least get primitives > which address *some* of the uses. sync.Pool is one such example. H

Re: [go-nuts] Go routine context

2022-10-01 Thread robert engels
I admit that I probably read into that based on the historical use of ThreadLocals to carry context in traditional ‘request is a thread’ systems. I think as Axel pointed out it is more explicit in the ’structured concurrency’ paper. In Java the Thread has always carried context - it is used in

[go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Shulhan
Hi gophers, The latest Go tip always fail with data race when running with -race and -coverprofile options. Here is an example of data race output, $ CGO_ENABLED=1 go test -failfast -race -count=1 -coverprofile=cover.out ./... ... == WARNING: DATA RACE Read at 0x01e5f04c

Re: [go-nuts] Re: Encrypting credentials config file in production and pseudo key rotation

2022-10-01 Thread Marcin Romaszewicz
Check out SOPS, we use it to commit encrypted secrets into Git and only people with access to keys can see them. https://github.com/mozilla/sops On Sat, Oct 1, 2022 at 2:59 AM Peter Galbavy wrote: > We have a different requirement, which is opaquing of credentials in user > visible config files

Re: [go-nuts] Go routine context

2022-10-01 Thread Anthony Martin
Robert Engels once said: > I think you’ll find the article interesting. It is certainly written > by a CS “god” that knows what he’s talking about. This is the same "god" that said: "Everyone thinks that the concurrency model is Go’s secret weapon, but I think their concurrency m

Re: [go-nuts] Go routine context

2022-10-01 Thread Robert Engels
I don’t see any arguments refuting the claim? Can you include a link so the analysis can be read in context? > On Oct 1, 2022, at 4:13 PM, Anthony Martin wrote: > > Robert Engels once said: >> I think you’ll find the article interesting. It is certainly written >> by a CS “god” that knows wha

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Rob Pike
When running coverage in a concurrent program, use the -mode=atomic flag to avoid data races in the counters. This unavoidably has a significant performance hit, but it should resolve this race. -rob On Sun, Oct 2, 2022 at 5:10 AM Shulhan wrote: > Hi gophers, > > The latest Go tip always fail

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Shulhan
On Sun, 2 Oct 2022 10:41:17 +1100 Rob Pike wrote: > When running coverage in a concurrent program, use the -mode=atomic > flag to avoid data races in the counters. This unavoidably has a > significant performance hit, but it should resolve this race. > > -rob > This flag print "no test files"