From 6aebf191ba8a0d47eb8b10f2701d000bb4b09e0d Mon Sep 17 00:00:00 2001 From: Ankur Date: Mon, 7 Nov 2022 13:37:13 +0000 Subject: [PATCH] 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: https://github.com/grafana/xk6-browser/issues/635 --- common/frame.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/frame.go b/common/frame.go index b4bb5cd40..dd6e66289 100644 --- a/common/frame.go +++ b/common/frame.go @@ -1789,9 +1789,6 @@ func (f *Frame) WaitForFunction(fn goja.Value, opts goja.Value, jsArgs ...goja.V k6ext.Panic(f.ctx, "parsing waitForFunction options: %w", err) } - f.executionContextMu.RLock() - defer f.executionContextMu.RUnlock() - js := fn.ToString().String() _, isCallable := goja.AssertFunction(fn) if !isCallable {