zamazan4ik / aws-gamelift-server-sdk-rs

MIT License
5 stars 1 forks source link

Attempt to remove inner server state deadlock #6

Closed Luminoth closed 2 years ago

Luminoth commented 2 years ago

Move mutable session state data into its own, RW guarded struct (this can use a parking_lot lock since it doesn't cross an await boundary) Guard ServerStateInner with a RW lock instead of a Mutex so it can have multiple consumers without contention Most ServerState methods don't need a mutable self anymore Most API methods don't need a mutable self anymore impl Default on HttpClient so that ServerState can derive Default Log after calling activate_game_session so we know it didn't lock up

Luminoth commented 2 years ago

This should resolve https://github.com/zamazan4ik/aws-gamelift-server-sdk-rs/issues/5. It's not super pretty but it definitely fixes the contention.

zamazan4ik commented 2 years ago

Thanks for the PR. I am merging it. If you have any additions or anything else - feel free to open the PR.

I will release the new version tomorrow.