Skip to contentSkip to conversation

] layerindex: Update tinfoil to call shutdown method

PATCH In review Aníbal Limón 2 participants 4 messages Jan 5, 2017 – Jan 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ] layerindex: Update tinfoil to call shutdown method

The new client/server API of tinfoil requires explicit call of shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance now isn't needed.

---
 layerindex/bulkchange.py           | 1 +
 layerindex/recipedesc.py           | 2 ++
 layerindex/recipeparse.py          | 6 ------
 layerindex/tools/import_classic.py | 1 +
 layerindex/update_layer.py         | 1 +
 5 files changed, 5 insertions(+), 6 deletions(-)
layerindex/bulkchange.py +1 -0
index 8102571..e32fae6 100644
@@ -231,6 +231,7 @@ def main():
 
         outp = generate_patches(tinfoil, fetchdir, changeset, sys.argv[2])
     finally:
+        tinfoil.shutdown()
         utils.unlock_file(lockfile)
 
     if outp:
layerindex/recipedesc.py +2 -0
index 43376cf..989988a 100644
@@ -89,6 +89,8 @@ def main():
             except Exception as e:
                 logger.info("Unable to read %s: %s", fullpath, str(e))
 
+    tinfoil.shutdown()
+
     sys.exit(0)
 
 
layerindex/recipeparse.py +0 -6
index 26c61aa..9cfd65c 100644
@@ -34,12 +34,6 @@ def _setup_tinfoil(bitbakepath, enable_tracking):
             tinfoil.cooker.enableDataTracking()
     tinfoil.prepare(config_only = True)
 
-    # XXX: Setup databuilder
-    tinfoil.databuilder = bb.cookerdata.CookerDataBuilder(tinfoil.config)
-    tinfoil.databuilder.parseBaseConfiguration()
-
-    tinfoil.cache = bb.cache.NoCache(tinfoil.databuilder)
-
     return tinfoil
 
 def _parse_layer_conf(layerdir, data):
layerindex/tools/import_classic.py +1 -0
index 45ccaa9..085401c 100755
@@ -201,6 +201,7 @@ def main():
         transaction.rollback()
     finally:
         transaction.leave_transaction_management()
+        tinfoil.shutdown()
 
     shutil.rmtree(tempdir)
     sys.exit(0)
layerindex/update_layer.py +1 -0
index 13b508f..58050f9 100644
@@ -611,6 +611,7 @@ def main():
         import traceback
         traceback.print_exc()
 
+    tinfoil.shutdown()
     shutil.rmtree(tempdir)
     sys.exit(0)
 
Signature · 1 line
2.1.4
#1 lore raw

Hi Aníbal,

Quoted 5 lines · On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:

The new client/server API of tinfoil requires explicit call of shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance now isn't needed.

This patch didn't apply against master - the databuilder piece does not appear to be there.

Since it was a simple patch, I've remade the changes (with most of your commit message) and pushed it to the paule/django18 branch that hopefully we'll be moving over to soon.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#2 lore raw
Quoted 11 lines · Paul Eggleton

Hi Aníbal,

Quoted 5 lines · On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:

The new client/server API of tinfoil requires explicit call of shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance now isn't needed.

This patch didn't apply against master - the databuilder piece does not appear to be there.

Great may be was my own changes against RRS,

Only a comment if your layerindex scripts don't call shutdown the update script seems blocked because never arrives the event.

Cheers,
alimon

Quoted 8 lines

Since it was a simple patch, I've remade the changes (with most of your commit message) and pushed it to the paule/django18 branch that hopefully we'll be moving over to soon.

Cheers,
Paul

#3 lore raw
Quoted 8 lines · On Wed, 11 Jan 2017 08:42:46 Aníbal Limón wrote:
Quoted 7 lines · Paul Eggleton
Quoted 5 lines · On Thu, 05 Jan 2017 15:21:36 Aníbal Limón wrote:

The new client/server API of tinfoil requires explicit call of shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance now isn't needed.

Quoted 7 lines
Quoted 2 lines

This patch didn't apply against master - the databuilder piece does not appear to be there.

Great may be was my own changes against RRS,

Only a comment if your layerindex scripts don't call shutdown the update script seems blocked because never arrives the event.

On the paule/django18 branch the update_layer.py script already calls shutdown(), and your patch takes care of the rest.

However this seems like a bug to me - if the client neglects to call shutdown() it would be nice if it didn't break things. Earlier I did use a destructor within the Tinfoil class to call shutdown() if it hadn't already been called, but I don't think that's reliable.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre