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

[releaser-4.7] Bug 1950131: fix deadlock in EgressFirewall DNS code #513

Commits on Apr 23, 2021

  1. fix deadlock in EgressFirewall DNS code

    Currently when adding EgressFirewalls with 5 or so dnsNames (observed
    with 5 dnsNames) it is probable that a deadlock will occur.
    
    thread openshift#1 calls (e *EgressDNS) Add() grabs lock e.lock and calls
    signalAdded(dnsName) and continues looping to the next dnsName calling
    (e *EgressDNS) Add() grabbing e.lock and trying to write to the channel
    
    thread openshift#2 recieves the signalAdded(dnsName) and is waiting to grab
    e.lock in updateEntry for name
    
    thread openshift#1 cannot write to the channel because the channel blocks waiting
    for the write and holds e.lock
    
    thread openshift#2 cannot continue with updateEntryForName() because it is wating
    for e.lock
    
    Solve this problem by taking the add goroutine out of the long running
    update goroutine. By spawning a goroutine for every DNS name the
    goroutines can wait until it is there turn to update.
    
    includes a small e2e test that should exercise the deadlocking codepaths
    
    Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com>
    JacobTanenbaum committed Apr 23, 2021
    Configuration menu
    Copy the full SHA
    13f6aae View commit details
    Browse the repository at this point in the history