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

CP-49129: Drop global lock around sexpr parsing #5682

Merged
merged 6 commits into from
Jun 12, 2024

Commits on Jun 12, 2024

  1. CP-49129: Add unit test for parallel parsing.

    Initial commit message:
    
    "Provides simple code to generate S-expression trees and attempt to parse them
    across a large number of threads. It serves to demonstrate that ocamlyacc's
    generated parses are not thread-safe (in that they modify a global variable
    "env")."
    
    Move Colin's unit test for parallel parsing into xapi.
    
    Signed-off-by: Colin Barr <colin.barr@cloud.com>
    Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
    contificate authored and GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    6e9a66a View commit details
    Browse the repository at this point in the history
  2. CP-49129: Make unit test run on alcotest.

    Make `test_sexpr` run using alcotest.
    
    Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
    GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    16fcea8 View commit details
    Browse the repository at this point in the history
  3. CP-49129: Replace ocamlyacc with menhir

    From https://ocaml.org/manual/5.1/lexyacc.html on ocamlyacc concurrency
    sefety:
    
    "Parsers generated by ocamlyacc are not thread-safe. Those parsers rely
    on an internal work state which is shared by all ocamlyacc generated parsers.
    The menhir parser generator is a better option if you want thread-safe parsers."
    
    We currently hold a global lock while calling the sexpr parser, so even if we
    try to parse a small sexpression, it'll be blocked behind parsing the large one.
    
    Switch to Menhir to make this thread-safe.
    
    Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
    GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    9f50af8 View commit details
    Browse the repository at this point in the history
  4. CP-49129: Drop global lock around sexpr parsing

    Using `ocamlyacc` with this change results in a test failure. Thus
    showing the issue of parallel parsing using `ocamlyacc`.
    
    Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
    GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    8e21bd8 View commit details
    Browse the repository at this point in the history
  5. CP-49045: replace all uses of ocamlyacc with menhir which is thread-safe

    Signed-off-by: Edwin Török <edwin.torok@cloud.com>
    edwintorok authored and GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    59e2371 View commit details
    Browse the repository at this point in the history
  6. CP-49129: Update quality-gate.sh for ocamlyacc

    We want to be sure there are no more uses of `ocamlyacc`, because of
    concurrency issues.
    
    Menhir should be used instead.
    
    Signed-off-by: Gabriel Buica <danutgabriel.buica@cloud.com>
    GabrielBuica committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    d6d5c4d View commit details
    Browse the repository at this point in the history