Commit 9ed3d9b
committed
issue2550839: Xapian, DatabaseLockError: Unable to get write lock on
db/text-index: already locked
I put in a retry loop that will attempt to get the lock. 10 tries with
a delaythatvaries from .02 seconds to .64 seconds. Total delay over 10
cycles approx. 4.5 seconds.
I can't figure out how to make pytest run two parallel processes to
test this code. I did try running:
./run_tests.py -k Xapian test/test_indexer.py &
./run_tests.py -k Xapian test/test_indexer.py
and confirmed that one of the processes seemed to hang on a test and
then threw a lock failure error. So at least the code path is being
exercised.
If anybody knows how to correctly test this I would love to do a real
test.1 parent a5ad726 commit 9ed3d9b
2 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
0 commit comments