Comments (2)
Closing res
can lead to a panic in the goroutine.
From the tour page you linked to:
A select blocks until one of its cases can run, then it executes that case. It chooses one at random if multiple are ready.
So if there's an ee
result and quit
is closed, it chooses randomly, and if it selects the <- ee
one, but res
is also closed, it will panic.
You can take the code from the tour page you linked to and adapt it a bit and when running it multiple times, it will lead to a panic sometimes (only sometimes because of the random selection): https://play.golang.org/p/isJ_jcKPYwg
I think it's safer to only close quit
. res
should then be garbage collected at some point.
from grpc-consul-resolver.
@tie Good catch. Thanks. I'll check and fix.
from grpc-consul-resolver.
Related Issues (18)
- WithBalancerName is deprecated HOT 2
- Update grpc version HOT 1
- Tag a new patch release HOT 1
- Use debug level instead of info for internal resolver state logging HOT 3
- Doubt call grpc.Builder some wrong in many connections scenario HOT 3
- Resolver ignores near sorting
- In the new version, the address already includes the port number HOT 1
- can you make release? HOT 3
- parameters ignored. HOT 1
- token error HOT 1
- Use multiple tags to select services HOT 1
- cannot use url.Endpoint (value of type func() string) as type string in array or slice literal HOT 7
- error handling HOT 1
- The terminal keeps getting errors:ERROR: [Consul resolver] Couldn't update client connection. error={bad resolver state} HOT 5
- Removal of tooling dependencies have not been released HOT 2
- epic: Support gRPC service config
- Add delay between attempts when can't fetch endpoints HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-consul-resolver.