Skip to content

Commit

Permalink
http-lib: log reason that causes lack of response
Browse files Browse the repository at this point in the history
Otherwise users are nonthewiser when a long migration fails. With this change
and a reproduction we can have the chance to understand the issue and maybe fix
it.

Backport of
f2d3a6ae3f and eb8d973c3c

Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
  • Loading branch information
psafont committed Oct 1, 2024
1 parent 3c62995 commit f1b1b42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion http-svr/http_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ let response_of_fd_exn fd =

(** [response_of_fd fd] returns an optional Http.Response.t record *)
let response_of_fd ?(use_fastpath = false) fd =
let __FUN = "Http_client.response_of_fd" in
try
if use_fastpath then
Some (response_of_fd_exn fd)
Expand All @@ -189,7 +190,12 @@ let response_of_fd ?(use_fastpath = false) fd =
with
| Unix.Unix_error (_, _, _) as e ->
raise e
| _ ->
| e ->
Backtrace.is_important e ;
let bt = Backtrace.get e in
Debug.log_backtrace e bt ;
D.debug "%s: returning no response because of the exception: %s" __FUN
(Printexc.to_string e) ;
None

(** See perftest/tests.ml *)
Expand Down

0 comments on commit f1b1b42

Please sign in to comment.