Skip to content

Race condition when closing both server and client at the same time#43

Open
yyewolf wants to merge 1 commit intovjeantet:masterfrom
yyewolf:master
Open

Race condition when closing both server and client at the same time#43
yyewolf wants to merge 1 commit intovjeantet:masterfrom
yyewolf:master

Conversation

@yyewolf
Copy link

@yyewolf yyewolf commented Jul 5, 2024

We had a weird issue with test not working from time to time, turns out there's a race condition if you close both a server and a client at the same time.

Take this example :

client.Close()
server.Stop()

In this case, the goroutine might close the client channel, but receive the server closed message first, meaning that it would try to send to the closed channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant