Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unblock connection receive when context is done (#781)
When context is canceled we don't read anymore from `t.incoming` channel because the select clause exists on `ctx.Done`. This change adds the same behavior to the point where `t.incoming` channel is written. Without this the call to `conn.Receive` could block forever given a race condition between a context cancellation and a new incoming message. Furthermore, is always a good practice to listen to `context.Done` on blocking points where a context variable is available. Signed-off-by: Iñigo Garcia Olaizola <[email protected]>
- Loading branch information