Minimal SQLite key-value store for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix test failures in cookeio, pds, irmin, and spacedata

- ocaml-cookeio: wrap test_clear in Eio_main.run to provide Eio context
- ocaml-pds: remove explicit Pds.close calls that double-closed the DB
when Eio.Switch.on_release already handles cleanup
- ocaml-sqlite: make sw field mutable; clear it in close so sync takes
the direct pager-write path instead of opening a new WAL on a dying
switch (fixes irmin's 17 failures and pds's "Switch finished!" errors)
- ocaml-spacedata: improve fetch_json timeout error message with URL
(2 live tests still fail due to CelesTrak being unreachable)

+9 -2
+9 -2
lib/sqlite.ml
··· 71 71 type t = { 72 72 pager : Btree.Pager.t; 73 73 file : Eio.File.rw_ty Eio.Resource.t option; 74 - sw : Eio.Switch.t option; 74 + mutable sw : Eio.Switch.t option; 75 75 db_path : Eio.Fs.dir_ty Eio.Path.t option; 76 76 mutable data : kv_table option; 77 77 mutable named_tables : (string * kv_table) list; ··· 707 707 if Eio.Path.is_file wp then Eio.Path.unlink wp 708 708 | _ -> Btree.Pager.sync t.pager 709 709 710 - let close t = sync t 710 + let close t = 711 + (* Clear sw so sync takes the direct-write path instead of opening a new WAL 712 + file. During close (and especially during Switch.on_release) the switch 713 + may already be tearing down, making Wal.v ~sw fail with 714 + "Switch finished!". Direct pager sync is safe here because we are doing a 715 + clean shutdown, not recovering from a crash. *) 716 + t.sw <- None; 717 + sync t 711 718 712 719 (* Transactions *) 713 720