Skip to contentSkip to conversation

hashserv: Don't daemonize server process

PATCH New Joshua Watt 1 participant 1 message Sep 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hashserv: Don't daemonize server process

The hash server process is terminated and waited on with join(), so it should not be a daemon. Daemonizing it cause races with the server cleanup, especially in the selftest because the process may not have terminated and cleanup up its socket before the test cleanup runs and tries to do it.

[YOCTO #13542]

---
 bitbake/lib/bb/cooker.py      | 1 -
 bitbake/lib/hashserv/tests.py | 1 -
 2 files changed, 2 deletions(-)
bitbake/lib/bb/cooker.py +0 -1
index 0c540028aed..20ef04d3ffd 100644
@@ -399,7 +399,6 @@ class BBCooker:
                 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
                 self.hashserv = hashserv.create_server(self.hashservaddr, dbfile, sync=False)
                 self.hashserv.process = multiprocessing.Process(target=self.hashserv.serve_forever)
-                self.hashserv.process.daemon = True
                 self.hashserv.process.start()
             self.data.setVar("BB_HASHSERVE", self.hashservaddr)
             self.databuilder.origdata.setVar("BB_HASHSERVE", self.hashservaddr)
bitbake/lib/hashserv/tests.py +0 -1
index 6584ff57b4a..a5472a996d2 100644
@@ -32,7 +32,6 @@ class TestHashEquivalenceServer(object):
 
         self.server = create_server(self.get_server_addr(), self.dbfile)
         self.server_thread = multiprocessing.Process(target=self._run_server)
-        self.server_thread.daemon = True
         self.server_thread.start()
         self.client = create_client(self.server.address)
 
Signature · 1 line
2.21.0