[sql] make busy timeout configurable

Summary:
Sometimes the default timeout of 10s is not enough(!). Make it
configurable while we work on not hitting it anyway.

Reviewed By: da319

Differential Revision: D10083772

fbshipit-source-id: ab949039f
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 7c89d92851
commit a3f428e90f

@ -281,6 +281,10 @@ OPTIONS
Activates: Enable --siof and disable all other checkers
(Conversely: --no-siof-only)
--sqlite-lock-timeout int
Timeout for SQLite results database operations, in milliseconds.
(default: 10000)
--starvation
Activates: starvation analysis (Conversely: --no-starvation)

@ -95,6 +95,10 @@ OPTIONS
Ignore files whose path matches the given prefix (can be specified
multiple times)
--sqlite-lock-timeout int
Timeout for SQLite results database operations, in milliseconds.
(default: 10000)
-- Stop argument processing, use remaining arguments as a build
command
BUCK COMPILATION DATABASE OPTIONS

@ -815,6 +815,10 @@ OPTIONS
Deactivates: print code excerpts around trace elements
(Conversely: --source-preview) See also infer-explore(1).
--sqlite-lock-timeout int
Timeout for SQLite results database operations, in milliseconds.
(default: 10000) See also infer-analyze(1), infer-capture(1), and infer-run(1).
--stacktrace file
File path containing a json-encoded Java crash stacktrace. Used to
guide the analysis (only with '-a crashcontext'). See

@ -137,6 +137,10 @@ OPTIONS
Ignore files whose path matches the given prefix (can be specified
multiple times)
--sqlite-lock-timeout int
Timeout for SQLite results database operations, in milliseconds.
(default: 10000)
--version
Print version information and exit

@ -815,6 +815,10 @@ OPTIONS
Deactivates: print code excerpts around trace elements
(Conversely: --source-preview) See also infer-explore(1).
--sqlite-lock-timeout int
Timeout for SQLite results database operations, in milliseconds.
(default: 10000) See also infer-analyze(1), infer-capture(1), and infer-run(1).
--stacktrace file
File path containing a json-encoded Java crash stacktrace. Used to
guide the analysis (only with '-a crashcontext'). See

@ -2004,6 +2004,13 @@ and specs_library =
specs_library
and sqlite_lock_timeout =
CLOpt.mk_int ~long:"sqlite-lock-timeout" ~default:10_000
~in_help:
InferCommand.[(Analyze, manual_generic); (Capture, manual_generic); (Run, manual_generic)]
"Timeout for SQLite results database operations, in milliseconds."
and sqlite_vfs =
let default =
match Utils.read_file "/proc/version" with
@ -2856,6 +2863,8 @@ and sourcepath = !sourcepath
and spec_abs_level = !spec_abs_level
and sqlite_lock_timeout = !sqlite_lock_timeout
and sqlite_vfs = !sqlite_vfs
and stacktrace = !stacktrace

@ -605,6 +605,8 @@ val spec_abs_level : int
val specs_library : string list
val sqlite_lock_timeout : int
val sqlite_vfs : string option
val stacktrace : string option

@ -142,7 +142,7 @@ end = struct
Sqlite3.db_open ~mode:`NO_CREATE ~cache:`PRIVATE ~mutex:`FULL ?vfs:Config.sqlite_vfs
database_fullpath
in
Sqlite3.busy_timeout db 10_000 ;
Sqlite3.busy_timeout db Config.sqlite_lock_timeout ;
SqliteUtils.exec db ~log:"synchronous=OFF" ~stmt:"PRAGMA synchronous=OFF" ;
database := Some db ;
List.iter ~f:(fun callback -> callback db) !new_db_callbacks

Loading…
Cancel
Save