<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>205280</bug_id>
          
          <creation_ts>2019-12-16 09:59:43 -0800</creation_ts>
          <short_desc>Python 3: Multiprocessing doesn&apos;t do well when nested</short_desc>
          <delta_ts>2019-12-16 15:41:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=205291</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=184986</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Bedard">jbedard</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1598940</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2019-12-16 09:59:43 -0800</bug_when>
    <thetext>Not quite clear why. We end up with some weird race conditions, I spent a few hours trying to get to the bottom of it with no luck. I can reproduce the problem except in unit testing, so I&apos;m inclined to defer investigation since run-webkit-tests works fine in Python 3 despite this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1598984</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-12-16 11:06:40 -0800</bug_when>
    <thetext>Which start method are we using with Python 3?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1598990</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2019-12-16 11:13:04 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #1)
&gt; Which start method are we using with Python 3?

Not sure what you mean by this.

For testing, I actually changed the shebang, but the code to run enable run-webkit-tests in Python3 isn&apos;t up for review quite yet, polishing that patch now. I&apos;ll be referencing this bug in that patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1599160</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-12-16 15:28:22 -0800</bug_when>
    <thetext>In Python 3, one can choose the underlying method for how multiprocessing works, it&apos;s called &quot;start method&quot;. See &lt;https://docs.python.org/3/library/multiprocessing.html&gt;.

As this bug is about multiprocessing having some strange behavior on tests with Python 3, it&apos;s relevant which of the methods you are using. I&apos;m guessing that it is &apos;spawn&apos; because that&apos;s the default. Since &apos;fork&apos; was the only one that Python 2 supported, that would be the 1:1 replacement, but of course we shouldn&apos;t be using that on macOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1599176</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2019-12-16 15:41:32 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #3)
&gt; In Python 3, one can choose the underlying method for how multiprocessing
&gt; works, it&apos;s called &quot;start method&quot;. See
&gt; &lt;https://docs.python.org/3/library/multiprocessing.html&gt;.
&gt; 
&gt; As this bug is about multiprocessing having some strange behavior on tests
&gt; with Python 3, it&apos;s relevant which of the methods you are using. I&apos;m
&gt; guessing that it is &apos;spawn&apos; because that&apos;s the default. Since &apos;fork&apos; was the
&gt; only one that Python 2 supported, that would be the 1:1 replacement, but of
&gt; course we shouldn&apos;t be using that on macOS.

I wasn&apos;t aware of this.

I haven&apos;t modified the start method used, so yes, it should be using spawn. Seems possible that the spawn/fork difference is the root of our problem, but I&apos;m still at a loss as to why I saw a race condition.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>