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

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11929</bug_id>
          
          <creation_ts>2017-08-14 17:12:09 +0000</creation_ts>
          <short_desc>preparing tinfoil twice with config_only=False is failing</short_desc>
          <delta_ts>2017-09-15 04:52:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M4</target_milestone>
          
          <blocked>10805</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75838</commentid>
    <comment_count>0</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-14 17:12:09 +0000</bug_when>
    <thetext>Running the sample example [1] with config_only = False and preparing tinfoil twice in the same python process is causing the following error:

NOTE: Starting bitbake server...
NOTE: Starting bitbake server...
Parsing recipes: 100% |#########################################################################################################################################################################################################| Time: 0:00:02
Parsing of 809 .bb files complete (0 cached, 809 parsed). 1258 targets, 44 skipped, 0 masked, 0 errors.
TMPDIR is &quot;/home/lsandov1/poky-testing/poky/b2/tmp&quot;
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection... (Traceback (most recent call last):
  File &quot;/home/lsandov1/poky-testing/poky/bitbake/lib/bb/main.py&quot;, line 451, in setup_bitbake
    server_connection = bb.server.process.connectProcessServer(sockname, featureset)
  File &quot;/home/lsandov1/poky-testing/poky/bitbake/lib/bb/server/process.py&quot;, line 448, in connectProcessServer
    server_connection.connection.updateFeatureSet(featureset)
  File &quot;/home/lsandov1/poky-testing/poky/bitbake/lib/bb/server/process.py&quot;, line 322, in updateFeatureSet
    _, error = self.runCommand([&quot;setFeatures&quot;, featureset])
  File &quot;/home/lsandov1/poky-testing/poky/bitbake/lib/bb/server/process.py&quot;, line 319, in runCommand
    return self.recv.get()
  File &quot;/home/lsandov1/poky-testing/poky/bitbake/lib/bb/server/process.py&quot;, line 562, in get
    res = self.reader.recv_bytes()
  File &quot;/usr/lib64/python3.4/multiprocessing/connection.py&quot;, line 216, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File &quot;/usr/lib64/python3.4/multiprocessing/connection.py&quot;, line 416, in _recv_bytes
    buf = self._recv(4)
  File &quot;/usr/lib64/python3.4/multiprocessing/connection.py&quot;, line 389, in _recv
    raise EOFError
EOFError
)
.
.
.



[1] https://wiki.yoctoproject.org/wiki/TipsAndTricks/Tinfoil</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75839</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-14 17:15:20 +0000</bug_when>
    <thetext>import os
import sys

# Set up sys.path to let us import tinfoil                                                                                                                                                                                                     
scripts_path = os.path.dirname(os.path.realpath(__file__))
lib_path = scripts_path + &apos;/lib&apos;
sys.path.insert(0, lib_path)
import scriptpath
scriptpath.add_bitbake_lib_path()

import bb.tinfoil

def auto(config_only):
    with bb.tinfoil.Tinfoil() as tinfoil:
        tinfoil.prepare(config_only=config_only)
        tmpdir = tinfoil.config_data.getVar(&apos;TMPDIR&apos;)
        print(&apos;TMPDIR is &quot;%s&quot;&apos; % tmpdir)
        data = tinfoil.cooker.recipecaches[&apos;&apos;].pkg_fn.items()
        # print(data)                                                   

    with bb.tinfoil.Tinfoil() as tinfoil:
        tinfoil.prepare(config_only=config_only)
        tmpdir = tinfoil.config_data.getVar(&apos;TMPDIR&apos;)
        print(&apos;TMPDIR is &quot;%s&quot;&apos; % tmpdir)

config_only = False
auto(config_only=config_only)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75844</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-08-14 21:40:53 +0000</bug_when>
    <thetext>Its trying to connect two UIs to one server which isn&apos;t supported. I agree the error should be better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76045</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-22 02:28:00 +0000</bug_when>
    <thetext>This seems to be working fine with latest master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76053</commentid>
    <comment_count>4</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-22 13:45:42 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; This seems to be working fine with latest master.

The must be something different between your setup and mine.

Can you try the scritpt (tinfoil-example.py) contained in [1] ?

I still see the issue. 

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=lsandov1/tinfoil-example</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76063</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-22 20:31:02 +0000</bug_when>
    <thetext>Yep, just ran the script you linked to, same result i.e.

---------------- snip ----------------
$ tinfoil-example.py
NOTE: Starting bitbake server...
NOTE: Starting bitbake server...
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2108 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:04
Parsing of 1514 .bb files complete (1430 cached, 84 parsed). 2108 targets, 102 skipped, 0 masked, 0 errors.
TMPDIR is &quot;/home/paul/poky/poky/build/tmp&quot;
NOTE: Starting bitbake server...
NOTE: Starting bitbake server...
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2108 entries from dependency cache.
TMPDIR is &quot;/home/paul/poky/poky/build/tmp&quot;
---------------- snip ----------------

I can try it on a different machine perhaps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76084</commentid>
    <comment_count>6</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-23 16:18:35 +0000</bug_when>
    <thetext>This patch fixes the problem

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/wip5&amp;id=693f3528ffbcc4e4c54c7c362c62fe02f708ce01

so removing the socket **before** cooker&apos;s shutdown fixes the problem.

Paul, I let you double check this so you can decide what to do with the status but for me is resolved/fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76108</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-23 23:14:54 +0000</bug_when>
    <thetext>It does seem to resolve the EOFError, but there&apos;s still an awkward reconnect (and delay to retry) - so it&apos;s an improvement but not where we&apos;d ideally like to get it to yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76114</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-08-24 11:10:41 +0000</bug_when>
    <thetext>Richard&apos;s latest patches resolve the delay as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76123</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-08-24 13:05:42 +0000</bug_when>
    <thetext>I&apos;ve merged http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=2b453483d4610945c6156cc7f472ffae803cb28a and http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=4152c472430db1b32c943026f8c976bb99b9717b which at least hopefully improves the situation (shorter retry and no tracebacks). Is it enough? Not sure...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76881</commentid>
    <comment_count>10</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-09-15 04:52:16 +0000</bug_when>
    <thetext>I think we&apos;ll call this done for the moment, and if there are other behavioural improvements we can make we&apos;ll deal with them separately.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>