Set busy timeout
authorSam Hartman <hartmans@debian.org>
Tue, 7 Oct 2014 10:08:55 +0000 (06:08 -0400)
committerSam Hartman <hartmans@debian.org>
Tue, 7 Oct 2014 11:00:34 +0000 (07:00 -0400)
Set a busy timeout in the tids sqlite3 setup code so that we do not
fail on any database locking.  As an example in 1.4 if two tids
processes try to write at the same time, one will fail.

tid/example/tids_main.c

index e920874..29a43b8 100644 (file)
@@ -276,6 +276,7 @@ int main (int argc,
     fprintf(stdout, "Error opening database %s\n", argv[4]);
     exit(1);
   }
+  sqlite3_busy_timeout( db, 1000);
   sqlite3_prepare_v2(db, "insert into psk_keys (keyid, key, client_dh_pub) values(?, ?, ?)",
                     -1, &insert_stmt, NULL);
   sqlite3_prepare_v2(db, "insert into authorizations (client_dh_pub, coi, acceptor_realm, hostname, apc) values(?, ?, ?, ?, ?)",