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

Race condition in server.go could cause panic on server close #230

Closed
Sandertv opened this issue Aug 7, 2021 · 0 comments
Closed

Race condition in server.go could cause panic on server close #230

Sandertv opened this issue Aug 7, 2021 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Sandertv
Copy link
Member

Sandertv commented Aug 7, 2021

In server.go, the channel to which newly joined players are added, is closed when the server is closed here: https://github.com/df-mc/dragonfly/blob/master/server/server.go#L336. When a player joins, https://github.com/df-mc/dragonfly/blob/master/server/server.go#L339 is called (note the go), which then, on another goroutine, submits a newly created player to the channel here: https://github.com/df-mc/dragonfly/blob/master/server/server.go#L381.

If a player is in the process of spawning and the server is closed, golang will panic because dragonfly will try to insert a value into a closed channel.

@Sandertv Sandertv added the bug Something isn't working label Aug 7, 2021
@Sandertv Sandertv modified the milestones: v0.4.0, v0.3.0 Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant