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

btf: fix race due to concurrent read access #1357

Merged
merged 1 commit into from
Feb 22, 2024

Commits on Feb 22, 2024

  1. btf: fix race due to concurrent read access

    Up until the introduction of lazy copying, reading from a Spec
    concurrently was safe. Now a read may trigger a copy and a write
    into the Spec, therefore causing a race on mutableTypes.
    
    Fix this by introducing a mutex which protects access to the
    mutable state. We need to be a bit careful here: copying in
    mutableTypes.add happens piecemeal, so we need to take a lock
    for the whole duration of modifyGraph.
    
    Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
    lmb committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    61be69d View commit details
    Browse the repository at this point in the history