Skip to contentSkip to conversation

server/process: Don't send heartbeats when no idle functions

PATCH In review Richard Purdie 2 participants 4 messages Nov 5, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 server/process: Don't send heartbeats when no idle functions

If there are no idle functions present, don't sent heartbeat events. These are only meant to happen while builds are active.

---
 lib/bb/server/process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/server/process.py +1 -1
index ad4035a738..b627ae0ab6 100644
@@ -477,7 +477,7 @@ class ProcessServer():
 
             # Create new heartbeat event?
             now = time.time()
-            if bb.event._heartbeat_enabled and now >= self.next_heartbeat:
+            if items and bb.event._heartbeat_enabled and now >= self.next_heartbeat:
                 # We might have missed heartbeats. Just trigger once in
                 # that case and continue after the usual delay.
                 self.next_heartbeat += self.heartbeat_seconds
#1 lore raw

PATCH 2/2 server/process: Decrease idle/main loop frequency

The idle and main loops have socket select calls to know when to execute. This means we can increase the normal timeout frequency since this is just a fall back and have some small efficiency gains.

---
 lib/bb/server/process.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/server/process.py +2 -2
index b627ae0ab6..4b35be62cd 100644
@@ -329,7 +329,7 @@ class ProcessServer():
                 bb.error("Idle thread terminated, main thread exiting too")
                 self.quit = True
 
-            nextsleep = 0.1
+            nextsleep = 1.0
             if self.xmlrpc:
                 nextsleep = self.xmlrpc.get_timeout(nextsleep)
             try:
@@ -439,7 +439,7 @@ class ProcessServer():
                 self.idle_cond.notify_all()
 
         while not self.quit:
-            nextsleep = 0.1
+            nextsleep = 1.0
             fds = []
 
             with bb.utils.lock_timeout(self._idlefuncsLock):
#2 lore raw

Re: [bitbake-devel] [PATCH 2/2] server/process: Decrease idle/main loop frequency

Quoted 5 lines · Richard Purdie

The idle and main loops have socket select calls to know when to execute. This means we can increase the normal timeout frequency since this is just a fall back and have some small efficiency gains.

Hi Richard,

This patch set does not apply cleanly on master nor on my master-next. I believe it misses the "Merge a function to simplfy code" from your master-next branch.

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

Re: [bitbake-devel] [PATCH 2/2] server/process: Decrease idle/main loop frequency

Quoted 7 lines · Mathieu Dubois-Briand
Quoted 6 lines · Richard Purdie

The idle and main loops have socket select calls to know when to execute.
This means we can increase the normal timeout frequency since this is
just a fall back and have some small efficiency gains.

Quoted 8 lines
Quoted 1 line

Hi Richard,

This patch set does not apply cleanly on master nor on my master- next. I
believe it misses the "Merge a function to simplfy code" from your master-next branch.

Sorry, I've sent that one as well. I need to stop missing a single patch like this!

Cheers,

Richard