Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all found race conditions, and dont send on nil channel #307

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

jonas747
Copy link
Contributor

@jonas747 jonas747 commented Jan 3, 2017

Some locking was incorrect, a lot was missing, i fixed all race conditions i could find using the -race detector on different bots.

I have tested shorter voice connections by having a bot connect to voice, play a 2 second long audio file, then disconnect, every 5 seconds for some hours.

Tested longer connections by having a music bot play a track on loop for a couple hours.

This will lower performance a bit, but it's better than to rely on undefined behaviour.

This pr is probably gonna be annoying to go through with all the new locking, sorry about that.

@iopred
Copy link
Collaborator

iopred commented Jan 3, 2017

Awesome, I'm going to run this on Septapus for a few days and make sure there's no deadlocks, then merge.

@jonas747
Copy link
Contributor Author

jonas747 commented Jan 3, 2017

nice nice

@jonas747
Copy link
Contributor Author

you find any problems with it @iopred ?

@iopred
Copy link
Collaborator

iopred commented Jan 10, 2017

Ack, so sorry Jonas, Septapus is now running with this patch. This time tomorrow should be enough :P

@iopred iopred merged commit bdb31f2 into bwmarrin:develop Jan 11, 2017
@bwmarrin bwmarrin added this to the v0.16.0 milestone Apr 18, 2017
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
@ashishjh-bst ashishjh-bst deleted the fix-data-races branch March 21, 2022 12:49
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.

None yet

3 participants