diff mbox series

[scarthgap,2.8,2/8] runqueue: Allow rehash loop to exit in case of interrupts

Message ID 80f5b5a7617e1883d05fc9c9d42b81026fab6c37.1717244760.git.steve@sakoman.com
State New
Headers show
Series [scarthgap,2.8,1/8] runqueue: Add timing warnings around slow loops | expand

Commit Message

Steve Sakoman June 1, 2024, 12:27 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

The initial hash serve loop exits in the case where interrupts are present
but probably checks a bit too often. Tweak that and also allow the slow
rehash loop to break on interrupt, improving bitbake Ctrl+C response.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/runqueue.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index beec1e046..85c3581f9 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1285,7 +1285,8 @@  class RunQueueData:
                     dealtwith.add(tid)
                     todeal.remove(tid)
                     self.prepare_task_hash(tid)
-                bb.event.check_for_interrupts(self.cooker.data)
+
+            bb.event.check_for_interrupts(self.cooker.data)
 
             if time.time() > (lasttime + 30):
                 lasttime = time.time()
@@ -2601,6 +2602,7 @@  class RunQueueExecute:
                 next |= self.rqdata.runtaskentries[tid].revdeps
                 total.remove(tid)
                 next.intersection_update(total)
+                bb.event.check_for_interrupts(self.cooker.data)
 
                 if time.time() > (lasttime + 30):
                     lasttime = time.time()