Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 7a45ec7

Browse files
authored
Fix deadlock with executionContextMu (#636)
executionContextMu isn't needed to be locked and unlocked in this (WaitForFunction) method as it doesn't r/w to executionContext or documentHandle. This function later calls an unexported method with the same name, which does require access to executionContext. A deadlock was occurring later in waitForExecutionContext since this method was holding on to the lock. Closes: #635
1 parent 86f96f4 commit 7a45ec7

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

common/frame.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,9 +1789,6 @@ func (f *Frame) WaitForFunction(fn goja.Value, opts goja.Value, jsArgs ...goja.V
17891789
k6ext.Panic(f.ctx, "parsing waitForFunction options: %w", err)
17901790
}
17911791

1792-
f.executionContextMu.RLock()
1793-
defer f.executionContextMu.RUnlock()
1794-
17951792
js := fn.ToString().String()
17961793
_, isCallable := goja.AssertFunction(fn)
17971794
if !isCallable {

0 commit comments

Comments
 (0)