-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for race condition: Allocation of Deleting GameServers Possible
If an allocation occurred during a Fleet scale down, or during a update of a Fleet, it was entirely possible for those parallel delete operations to be applied to a GameServer that was being allocated at the same time. This is mainly because the client-go informer cache is lazily consistent, but also because there was nothing preventing a `Delete()` of a `GameServer` from happening while allocating a specific `GameServer`. To solve this, there are two strategies implemented here: 1. Share the `allocationLock` `sync.Mutex` between controllers such that allocations cannot occur while `GameServer` Deletes for Fleet resizing/update are happening and vice versa. 2. use `cache.WaitForCacheSync` to bring the cluster informer up to date, to remove the chance for non-updated information about `GameServers` to be acted upon. The shared lock is a quite broad approach - down the line, we could refine this to being per `Fleet`, or per `GameServerSet`, if we find this to be a bottleneck, but the priority here was to get something working that resolves the issue, and we can optimise as needed from here. There are also e2e tests specifically designed for catching these race conditions as well.
- Loading branch information
1 parent
c1c5f41
commit e6818e3
Showing
9 changed files
with
185 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.