Skip to content

Commit

Permalink
master_connection: log why we failed to connect
Browse files Browse the repository at this point in the history
Previously the exception would've been completely ignored, so all we've seen in the logs was the
successful connection attempt, and then closing the connection after sending 0 bytes.
We were not seeing that Thread.wait_timed_read raised an exception due to a file descriptor having a value >1024.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
  • Loading branch information
edwintorok committed Jun 18, 2024
1 parent c2b6a2a commit 9061698
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ocaml/database/master_connection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ let do_db_xml_rpc_persistent_with_reopen ~host:_ ~path (req : string) :
!Db_globs.permanent_master_failure_retry_interval ;
Thread.delay !Db_globs.permanent_master_failure_retry_interval ;
!Db_globs.restart_fn ()
| e -> (
| e ->
error "Caught %s" (Printexc.to_string e) ;
(* RPC failed - there's no way we can recover from this so try reopening connection every 2s + backoff delay *)
( match !my_connection with
Expand Down Expand Up @@ -322,9 +322,7 @@ let do_db_xml_rpc_persistent_with_reopen ~host:_ ~path (req : string) :
debug "%s: Sleep interrupted, retrying master connection now"
__FUNCTION__ ;
update_backoff_delay () ;
try open_secure_connection () with _ -> ()
(* oh well, maybe nextime... *)
)
D.log_and_ignore_exn open_secure_connection
done ;
!result

Expand Down

0 comments on commit 9061698

Please sign in to comment.