Re: [go-nuts] Is there any way to produce etcd watch chan be closed

2022-03-27 Thread 袁成若
Ok, thanks. Ian Lance Taylor 于2022年3月26日周六 02:45写道: > On Fri, Mar 25, 2022 at 11:41 AM 袁成若 wrote: > > > > I met a problem about etcd watch channel. seems that be closed, but i > can not reproduce it. > > > > like this: > > > > ``` > > for { > > ach :=

Re: [go-nuts] Is there any way to produce etcd watch chan be closed

2022-03-25 Thread Sam Hughes
As written above, if that's the main thread, it is guaranteed to freeze in a deadlock every time. I don't see a goroutine kicked off, so I'm assuming you're trying to run that on the main thread, and you will be 100%, always, forever stuck on the `case wch := <- ach {` line. Channel reads are

Re: [go-nuts] Is there any way to produce etcd watch chan be closed

2022-03-25 Thread Ian Lance Taylor
On Fri, Mar 25, 2022 at 11:41 AM 袁成若 wrote: > > I met a problem about etcd watch channel. seems that be closed, but i can > not reproduce it. > > like this: > > ``` > for { > ach := etcdClientV3.Watch(context.Background(), "/test", > clientv3.WithPrefix()) > for { > select

[go-nuts] Is there any way to produce etcd watch chan be closed

2022-03-25 Thread 袁成若
I met a problem about etcd watch channel. seems that be closed, but i can not reproduce it. like this: ``` for { ach := etcdClientV3.Watch(context.Background(), "/test", clientv3.WithPrefix()) for { select { case wch := <- ach {