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

Add a mutex to js.VU to prevent multiple asynchrnous calls to RunOnce #1252

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

mstoykov
Copy link
Contributor

This should fix #867.
This is not ... a great fix in the sense that while doing it I found out
we are also asynchrnously touch VU.Runtime which should also not happen
and the currently added mutex should probably be locked in most other
functions, but this should fix the immediate problems and the other
should be fixed in a more ... complete redesign :)

This should fix #867.
This is not ... a great fix in the sense that while doing it I found out
we are also asynchrnously touch VU.Runtime which should also not happen
and the currently added mutex should probably be locked in most other
functions, but this should fix the immediate problems and the other
should be fixed in a more ... complete redesign :)
@mstoykov mstoykov added this to the v0.26.0 milestone Nov 25, 2019
@mstoykov mstoykov requested review from imiric, na-- and cuonglm November 25, 2019 13:17
@@ -534,6 +535,56 @@ func TestVURunInterrupt(t *testing.T) {
}
}

func TestVURunInterruptDoesntPanic(t *testing.T) {
//TODO: figure out why interrupt sometimes fails... data race in goja?
Copy link
Member

Choose a reason for hiding this comment

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

I think the issue would disappear after we update goja to include this fix: dop251/goja@f95411d

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we even have an issue for this ... maybe we should upgrade goja ... soon ™️

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

I don't particularly love the test, but LGTM

js/runner.go Show resolved Hide resolved
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

LGTM, and same concern about the test, but I don't see how we could improve it.

@mstoykov mstoykov merged commit a2e1c6f into master Nov 25, 2019
@mstoykov mstoykov deleted the fixPanic branch November 25, 2019 15:01
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.

Rare panic(s) in goja
4 participants