From: Stefano Tondo <stondo@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>,
Peter Marko <peter.marko@siemens.com>,
Stefano Tondo <stefano.tondo.ext@siemens.com>
Subject: [PATCH] tinfoil: Disable data tracking also when the operation fails
Date: Mon, 23 Nov 2026 21:36:08 +0100 [thread overview]
Message-ID: <20261123203608.867455-1-stondo@gmail.com> (raw)
From: Stefano Tondo <stefano.tondo.ext@siemens.com>
_data_tracked_if_enabled() enables data tracking before the operation
and disables it after the operation. If the operation raises an
exception, the second step does not run and tracking stays enabled in
the server for the rest of the tinfoil session.
Disable tracking in a finally block.
Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com>
---
lib/bb/tinfoil.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 9b9925e51..4fd2a9af8 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -789,10 +789,11 @@ class Tinfoil:
self.run_command('enableDataTracking')
# Here goes the operation with the optional data tracking
- yield
-
- if self.tracking:
- self.run_command('disableDataTracking')
+ try:
+ yield
+ finally:
+ if self.tracking:
+ self.run_command('disableDataTracking')
def finalizeData(self):
"""
--
2.56.1
reply other threads:[~2026-11-23 20:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123203608.867455-1-stondo@gmail.com \
--to=stondo@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=peter.marko@siemens.com \
--cc=richard.purdie@linuxfoundation.org \
--cc=stefano.tondo.ext@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.