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 bug with hung GameServer resource on Kubernetes 1.10 #278

Merged

Commits on Jun 30, 2018

  1. Fix bug with hung GameServer resource on Kubernetes 1.10

    It looks like the `foregroundDeletion` finalizer that gets added to the
    GameServer when a deletion with foreground propogation is requested -
    when it gets removed, by the Kubernetes system, the ResourceVersion/Generation
    doesn't get incremented.
    
    This means when we do an `Update` it will go through (usually it fails if the
    ResourceVersion/Generation has changed since the last update), rather than
    failing and going back to re-sync.
    
    This can cause a race condition where the `Update` can basically put back
    the `foregroundDeletion` finalizer, if it gets removed between retrieving the
    `GameServer` object and doing the `Update()` operation.
    
    We actually don't need the `foregroundDeletion` propogation on `Delete()`, as
    we only want to keep the `GameServer` around until the backing `Pod` is gone,
    so we can actually just turn this off instead in the code.
    
    As a note - also explored using a `Patch()` operation to try and solve this
    problem. AFAIK, a patch (and specifically a JSONPatch - other patch types
    didn't seem better), can only do index based removal from a list of items.
    
    This could just present other types of race conditions, as finalizers could
    be added/removed by other systems at the same time as well, changing the index
    to the finalizer we want at the same time.
    
    Not sure if this is a bug in the Kubernetes system, or working as intended,
    but this solves the issue.
    markmandel committed Jun 30, 2018
    Configuration menu
    Copy the full SHA
    a06119c View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2018

  1. Configuration menu
    Copy the full SHA
    2da724b View commit details
    Browse the repository at this point in the history