fullstorydev / grpchan

Channels for gRPC: custom transports
MIT License
205 stars 23 forks source link

fix goroutine leak in inprocgrpc #17

Closed jhump closed 6 years ago

jhump commented 6 years ago

Adds a test that confirms that unary RPCs can leak goroutines when the RPC is cancelled or is deadline is exceeded. Adds a fix: writes to channel must use select operation to respect RPC context. Otherwise, channel write operation can block indefinitely (causing goroutine to leak) because there is nothing reading the channel.