Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a pause when we iter on the index file and when we decompress a PACK file #631

Merged
merged 7 commits into from
Feb 11, 2024
9 changes: 7 additions & 2 deletions src/git/mem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,13 @@ module Make (Digestif : Digestif.S) = struct
in
let iter index ~f =
let f (uid, offset) = f uid offset in
let f ~uid ~offset ~crc:_ = Lwt.apply f (uid, offset) in
Carton.Dec.Idx.map ~f index |> Lwt.join
(* XXX(dinosaure): when the pack is huge, we must give a pause
for each entry because our [batch_write] tries to extract all
objects the second time. *)
let f ~uid ~offset ~crc:_ =
Lwt.apply f (uid, offset) >>= fun res ->
Lwt.pause () >>= Lwt.return res in
dinosaure marked this conversation as resolved.
Show resolved Hide resolved
Carton.Dec.Idx.map ~f index |> Lwt.join >>= Lwt.pause
in
let map pck_contents ~pos len =
let pos = Int64.to_int pos in
Expand Down