Fix database is locked error
Bug:
1. Create quickly around 10-30 job requests (same .yml can be used)
2. List Weles jobs after few seconds.
3. Some of the jobs should have following:
"info": "Internal Weles error while creating file path in ArtifactDB : database is locked",
When Weles received requests in quick succession it tried to write to
database in more than 1 goroutine. This resulted in "database is locked"
error. This should be resolved by handling this error or customizing
sqlite3 settings.
The issue is described in the following thread:
https://github.com/mattn/go-sqlite3/issues/274
This commit:
- adds logging of artifact insert failure
- sets _BUSY_TIMEOUT of sqlite3 to 5s
- limits max No of open db connections to 1
- fixes tests which failed inconsistently in CI
Verification:
Build Weles with this commit, go through steps below "Bug:". Jobs should
not fail due to "database is locked"
Change-Id: I45dd00e832df0cb234d49b219ad736c37a4be629
Signed-off-by: Alexander Mazuruk <a.mazuruk@samsung.com>