Commit f3051f4
fix(l1): close background threads before dropping db (#5749)
**Motivation**
The error `pthread lock: Invalid argument` has been happening rarely
with rocksdb, but #5497 manages to trigger it consistently so it should
be fixed soon.
This PR is inspired by @PivasDesant's solution (see #5661)
**Description**
Stops background DB threads before dropping the inner database object.
The store background threads do not need to be stopped since these hold
a reference to the db (preventing it from being dropped early).
#5658 contains a script to test the fix by running the rocksdb test a
thousand times
<!-- A clear and concise general description of the changes this PR
introduces -->
<!-- Link to issues: Resolves #111, Resolves #222 -->
**Checklist**
- [X] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR
includes breaking changes to the `Store` requiring a re-sync.
Closes #5658
---------
Co-authored-by: Edgar <[email protected]>1 parent c0dd265 commit f3051f4
2 files changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
148 | 164 | | |
149 | 165 | | |
150 | 166 | | |
| |||
1273 | 1289 | | |
1274 | 1290 | | |
1275 | 1291 | | |
1276 | | - | |
| 1292 | + | |
| 1293 | + | |
1277 | 1294 | | |
1278 | 1295 | | |
1279 | 1296 | | |
| |||
1283 | 1300 | | |
1284 | 1301 | | |
1285 | 1302 | | |
| 1303 | + | |
1286 | 1304 | | |
1287 | 1305 | | |
1288 | 1306 | | |
1289 | | - | |
| 1307 | + | |
1290 | 1308 | | |
1291 | 1309 | | |
1292 | 1310 | | |
| |||
1302 | 1320 | | |
1303 | 1321 | | |
1304 | 1322 | | |
1305 | | - | |
| 1323 | + | |
1306 | 1324 | | |
1307 | 1325 | | |
1308 | 1326 | | |
| |||
1326 | 1344 | | |
1327 | 1345 | | |
1328 | 1346 | | |
1329 | | - | |
| 1347 | + | |
1330 | 1348 | | |
1331 | 1349 | | |
1332 | 1350 | | |
| |||
1346 | 1364 | | |
1347 | 1365 | | |
1348 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1349 | 1370 | | |
1350 | 1371 | | |
1351 | 1372 | | |
| |||
0 commit comments