Commit 3cd2cfc
committed
Fix parallel chunk scanning sharing single DB connection across threads (v2.6.38)
Parallel chunk workers (v2.6.32+) shared the parent PixelProbe instance
which uses StaticPool with a single DB connection. Concurrent _save_to_cache()
calls from 3+ threads caused silent write loss -- files ended up with
scan_status='completed' but scan_date=NULL. The v2.6.36 raw SQL UPDATE
masked this by marking unscanned files as done.
Fix: each chunk worker thread gets its own PixelProbe instance via
threading.local(), with tracked engine disposal after scanning completes.1 parent a260b69 commit 3cd2cfc
3 files changed
Lines changed: 36 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
1460 | | - | |
| 1460 | + | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
1468 | 1475 | | |
1469 | 1476 | | |
1470 | 1477 | | |
| |||
1490 | 1497 | | |
1491 | 1498 | | |
1492 | 1499 | | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1493 | 1510 | | |
1494 | 1511 | | |
1495 | | - | |
| 1512 | + | |
1496 | 1513 | | |
1497 | 1514 | | |
1498 | 1515 | | |
| |||
1639 | 1656 | | |
1640 | 1657 | | |
1641 | 1658 | | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1642 | 1667 | | |
1643 | 1668 | | |
1644 | 1669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments