Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only add connection to ch.conns if it's active
If a connection becomes active, and then closes almost immediately, then it's possible that the close is handled before onActive is done processing which leads to adding a inactive connection to ch.conns. This causes the test TestTimeoutCallsThenClose to fail with state mismatch since the number of connections has changed. Check the connection state before adding it to the channel to avoid this race.
- Loading branch information