Patchwork [bitbake-devel] persist_data: Avoid fsync() calls

mail settings
Submitter Richard Purdie
Date May 3, 2014, 10:18 a.m.
Message ID <1399112313.12731.99.camel@ted>
Download mbox | patch
Permalink /patch/71433/
State New
Headers show


Richard Purdie - May 3, 2014, 10:18 a.m.
If the power were to fail, it doesn't matter to us much if the data
makes it to disk or not, we'd have other problems. However an fsync()
call on a multi build autobuilder is painful so lets avoid them.

This is particularly true in this case if a timeout causes a reconnect
during a build.

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 994e61b..5795bc8 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -199,7 +199,9 @@  class PersistData(object):
 def connect(database):
-    return sqlite3.connect(database, timeout=5, isolation_level=None)
+    connection = sqlite3.connect(database, timeout=5, isolation_level=None)
+    connection.execute("pragma synchronous = off;")
+    return connection
 def persist(domain, d):
     """Convenience factory for SQLTable objects based upon metadata"""