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 racing in Open #171

Merged
merged 2 commits into from
Feb 8, 2023
Merged

Fix racing in Open #171

merged 2 commits into from
Feb 8, 2023

Commits on Feb 7, 2023

  1. Lock allocator assignment in openComplete

    Related to #170. There is an edge case where the background frame
    handler receives an error before `Open` completes. In this case, there
    is a data race to assign the value of the allocator. The destructor in
    shutdown is already a critical section. Adding a tiny critical section
    in openComplete to protect the allocator.
    
    Signed-off-by: Aitor Perez Cedres <acedres@vmware.com>
    Zerpet committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    c503330 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2023

  1. Add a critical section in openTune

    Related to #170. There is an edge case where the TCP connection between
    client-server is setup, and AMQP handshake starts, up to the point right
    after sending Tune frame. At this point, the background frame reader
    receives an error from the TCP socket and starts the shutdown sequence.
    At the same time, the Tune function continues (as it has not completed)
    and attempts to set the ChannelMax field in the connection struct. At
    the same time, the shutdown sequence initiated by the error in the frame
    handler reads the ChannelMax field. This creates a race.
    
    A potential solution is to add a critical section in tune to protect
    access to ChannelMax field. The destructor in the shutdown sequence is
    already a critical section, protected by the struct mutex.
    
    Signed-off-by: Aitor Perez Cedres <acedres@vmware.com>
    Zerpet committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    0ecb414 View commit details
    Browse the repository at this point in the history