Title: [254290] trunk/Tools
Revision
254290
Author
commit-qu...@webkit.org
Date
2020-01-09 12:35:06 -0800 (Thu, 09 Jan 2020)

Log Message

Race condition in run-jsc-stress-tests chdir
https://bugs.webkit.org/show_bug.cgi?id=205910

Patch by Paulo Matos <pma...@igalia.com> on 2020-01-09
Reviewed by Keith Miller.

chdir block was in a race condition when multiple remotes are used.
As an example of this see line 3345 of:
  https://ews-build.webkit.org/#/builders/26/builds/5719/steps/12/logs/stdio

quote error:
Tools/Scripts/run-jsc-stress-tests:1946: warning: conflicting chdir during another chdir block

Multiple threads should not enter a chdir block simultaneously, therefore we need
a mutex to guard it. More information is here:
  https://bugs.ruby-lang.org/issues/15661

* Scripts/run-jsc-stress-tests:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (254289 => 254290)


--- trunk/Tools/ChangeLog	2020-01-09 20:24:24 UTC (rev 254289)
+++ trunk/Tools/ChangeLog	2020-01-09 20:35:06 UTC (rev 254290)
@@ -1,3 +1,23 @@
+2020-01-09  Paulo Matos  <pma...@igalia.com>
+
+        Race condition in run-jsc-stress-tests chdir
+        https://bugs.webkit.org/show_bug.cgi?id=205910
+
+        Reviewed by Keith Miller.
+
+        chdir block was in a race condition when multiple remotes are used.
+        As an example of this see line 3345 of:
+          https://ews-build.webkit.org/#/builders/26/builds/5719/steps/12/logs/stdio
+
+        quote error:
+        Tools/Scripts/run-jsc-stress-tests:1946: warning: conflicting chdir during another chdir block
+
+        Multiple threads should not enter a chdir block simultaneously, therefore we need
+        a mutex to guard it. More information is here:
+          https://bugs.ruby-lang.org/issues/15661
+
+        * Scripts/run-jsc-stress-tests:
+
 2020-01-09  Ryan Haddad  <ryanhad...@apple.com>
 
         Move commit queue to Mojave

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (254289 => 254290)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2020-01-09 20:24:24 UTC (rev 254289)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2020-01-09 20:35:06 UTC (rev 254290)
@@ -1941,11 +1941,14 @@
     return numProcessors
 end
 
+$runnerDirMutex = Mutex.new
 def runAndMonitorTestRunnerCommand(*cmd)
     numberOfTests = 0
-    Dir.chdir($runnerDir) {
-        # -1 for the runscript, and -2 for '..' and '.'
-        numberOfTests = Dir.entries(".").count - 3
+    $runnerDirMutex.synchronize {
+        Dir.chdir($runnerDir) {
+            # -1 for the runscript, and -2 for '..' and '.'
+            numberOfTests = Dir.entries(".").count - 3
+        }
     }
     unless $progressMeter
         mysys(cmd.join(' '))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to