Re: [go-nuts] How to drop old value in a channel salety

2020-11-12 Thread 陶青云
It is not a one-length buffered channel. I need to drop because the recveiver do heavy work that can't process as quickly as sender. 在2020年11月13日星期五 UTC+8 下午2:36:13 写道: > On Thu, Nov 12, 2020 at 9:32 PM 陶青云 wrote: > >> Thanks. I want the receiver always get the relately new vaule, I don't

Re: [go-nuts] How to drop old value in a channel salety

2020-11-12 Thread Kurtis Rader
On Thu, Nov 12, 2020 at 9:32 PM 陶青云 wrote: > Thanks. I want the receiver always get the relately new vaule, I don't > want the sender blocked and I either choose drop the current value or the > first value of the channel. But I don't find a way to safely drop the first > value from the channel.

Re: [go-nuts] How to drop old value in a channel salety

2020-11-12 Thread 陶青云
Thanks. I want the receiver always get the relately new vaule, I don't want the sender blocked and I either choose drop the current value or the first value of the channel. But I don't find a way to safely drop the first value from the channel. Maybe like this ? ``` // c is buffered channel

Re: [go-nuts] How to drop old value in a channel salety

2020-11-12 Thread Kurtis Rader
On Thu, Nov 12, 2020 at 6:19 PM 陶青云 wrote: > ``` > // c is buffered channel > select { > case c <- result: > default: > // full, drop old one > <-c > c <- result > } > ``` > > I have a code like this, but there may be a race condition in the default > case. I enconter a >

Re: [go-nuts] How to drop old value in a channel salety

2020-11-12 Thread Ian Lance Taylor
On Thu, Nov 12, 2020 at 6:19 PM 陶青云 wrote: > > ``` > // c is buffered channel > select { > case c <- result: > default: > // full, drop old one > <-c > c <- result > } > ``` > > I have a code like this, but there may be a race condition in the default > case. I enconter a >

[go-nuts] How to drop old value in a channel salety

2020-11-12 Thread 陶青云
``` // c is buffered channel select { case c <- result: default: // full, drop old one <-c c <- result } ``` I have a code like this, but there may be a race condition in the default case. I enconter a deadlock that the goroutine block on 'c<'. -- You received this

[go-nuts] [security] Go 1.15.5 and Go 1.14.12 are released

2020-11-12 Thread Katie Hockman
Hi gophers, We have just released Go 1.15.5 and Go 1.14.12 to address recently reported security issues. We recommend that all users update to one of these releases (if you’re not sure which, choose Go 1.15.5). - math/big: panic during recursive division of very large numbers A number of

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Denis Telyukh
> If you switch to http rather than http2 do you have the same issue? No, I haven't. > have you tried running your code under the race detector? Yes, I did. > Since you encounter it on localhost I assume you can extract what is needed based on the other issues cited. It's not easy, but I could

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Brian Candler
On Thursday, 12 November 2020 14:34:35 UTC, Robert Engels wrote: > > One thing to note, gRPC uses http2. If there were a bug like this lurking > in the library it would be far more common, so the most likely cause is > specific to your code. > To the OP: have you tried running your code under

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Robert Engels
After reading that issue and the related ones there does appear to be a live lock under heavy stress. I didn’t read too deeply because I am on a phone. I am guessing a small reproducible test case is required. Since you encounter it on localhost I assume you can extract what is needed based on

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Denis Telyukh
Could you, please, explain me what is producer in this case and what is consumer? Is it web browser and web server? And what kind of anomalies do you think I can find with netstat? I'm not sure what to look at, the traffic seems fine to me. Maybe this issue is related the same problem:

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Robert Engels
One thing to note, gRPC uses http2. If there were a bug like this lurking in the library it would be far more common, so the most likely cause is specific to your code. > On Nov 12, 2020, at 8:13 AM, Robert Engels wrote: > >  > Your issue report describes the same issue. > > If you switch

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Robert Engels
Your issue report describes the same issue. If you switch to http rather than http2 do you have the same issue? I am guessing that your consumer is blocked which eventually blocks your producer when the buffers fill. I would continue to use the networking tools to diagnose. > On Nov 12,

Re: [go-nuts] [generics] type lists in interfaces

2020-11-12 Thread Ian Lance Taylor
On Thu, Nov 12, 2020 at 5:15 AM 武新飞 wrote: > > Here is my suggestion to replace "Type lists in interfaces" > ``` > type Float interface { > type float32, float64 > } > ``` > Can be > ``` > type Float = float32 | float64 > > type Ordered = int | int32 | ... Float | string > ``` Thanks for

[go-nuts] [generics] type lists in interfaces

2020-11-12 Thread ??????
Here is my suggestion to replace "Type lists in interfaces" ``` type Float interface { type float32, float64 } ``` Can be ``` type Float = float32 | float64 type Ordered = int | int32 | ... Float | string ``` -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: My app hangs up at some point in net/http/h2_bundle.go. What is the better way to debug?

2020-11-12 Thread Denis Telyukh
Better problem description after deeper debugging: https://github.com/golang/go/issues/42534 среда, 11 ноября 2020 г. в 13:21:56 UTC+7, Denis Telyukh: > OS: Manjaro 20.2 Nibia > Kernel: x86_64 Linux 5.4.74-1-MANJARO > > ср, 11 нояб. 2020 г. в 12:59, Kurtis Rader : > >> On Tue, Nov 10, 2020 at