Skip to content

Fix race condition in handling streams#6

Open
Mahdi-zarei wants to merge 3 commits intoSagerNet:devfrom
Mahdi-zarei:fix-race
Open

Fix race condition in handling streams#6
Mahdi-zarei wants to merge 3 commits intoSagerNet:devfrom
Mahdi-zarei:fix-race

Conversation

@Mahdi-zarei
Copy link
Copy Markdown

@Mahdi-zarei Mahdi-zarei commented Dec 11, 2023

Since Stream object was created out of the for loop and it was being used in another goroutine, some race conditions were happening that caused some odd behaviors. For example a nil pointer was occurring on error.go:15 which is quite abnormal.
This pr successfully removes the race condition by initializing the stream object inside the loop and therefore exclusive for each goroutine.

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.

2 participants