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 read/write race condition for edge case #1038

Merged
merged 2 commits into from
Sep 18, 2023

Commits on Sep 18, 2023

  1. Fix read/write race condition for edge case

    This mutex is only needed in an edge case where we have multiple
    instances of k6 connecting to the same chrome instance. In this
    case when a page is created by the first k6 instance, the second
    instance of k6 will also receive an onAttachedToTarget event. When
    this occurs there's a small chance that at the same time a new
    context is being created by the second k6 instance. So the read
    occurs in getDefaultBrowserContextOrMatchedID which is called by
    onAttachedToTarget, and the write in NewContext. This mutex protects
    the read/write race condition for this one case.
    ankur22 committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    000967f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4edcc62 View commit details
    Browse the repository at this point in the history