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

browser: Mark a bunch of places where races happen #4521

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

mstoykov
Copy link
Contributor

What?

In a lot of places in the k6ext.Promise will create a separate goroutine and then access the arguments in it. This isn't safe and will race with anything running on the event loop.

It is very likely that this happens very rarely especially as in a bunch of the cases this is only for opts - which seems to be less used in most cases.

Additionally in a bunch of cases mapping back to the sobek.Values is done in that same goroutine instead of on the event loop.

Why?

I am marking all of those in one commit and not fixing them all as that will take a lot longer and likely a bunch of them will not be the same as the rest.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

In a lot of places in the k6ext.Promise will create a separate goroutine
and then access the arguments in it. This isn't safe and will race with
anything running on the event loop.

It is very likely that this happens very rarely especially as in a bunch
of the cases this is only for `opts` - which seems to be less used in
most cases.

Additionally in a bunch of cases mapping back to the sobek.Values is
done in that same goroutine instead of on the event loop.

I am marking all of those in one commit and not fixing them all as that
will take a lot longer and likely a bunch of them will not be the same
as the rest.
@mstoykov mstoykov requested a review from a team as a code owner February 10, 2025 09:24
@mstoykov mstoykov requested review from oleiade and codebien and removed request for a team February 10, 2025 09:24
Copy link
Contributor

@codebien codebien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstoykov mstoykov merged commit b09f45f into master Feb 10, 2025
28 checks passed
@mstoykov mstoykov deleted the fixBrowserRacesInMapping branch February 10, 2025 10:10
@inancgumus
Copy link
Member

Just to document/link issues and PRs.

#4219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants