thundernetes icon indicating copy to clipboard operation
thundernetes copied to clipboard

Remove finalizer from GameServer

Open dgkanatsios opened this issue 2 years ago • 0 comments

Currently, when a GameServer is to be deleted, Thundernetes sets up a finalizer. The finalizer is used to handle the port deallocation from memory, so the ports occupied by the deleted GameServer can be re-used by another one. We cannot use the apierrors.IsNotFound solution since the ports are stored in the hostPort fields of the GameServer and thus, not available when it is deleted. What we can do is store a cache of [GameServerName string, HostPorts []int] inside the PortRegistry, so we can delete these ports when the GameServer is apierrors.IsNotFound. This will simplify the codebase and the deletion logic.

dgkanatsios avatar Jun 13 '22 23:06 dgkanatsios