Skip to content

Commit 89446eb

Browse files
gabelevifacebook-github-bot
authored andcommitted
Cleaner monitor logging when a connection is closed from the other side
Summary: Slightly better message in the log when a connection is closed from the other side. Reviewed By: jbrown215 Differential Revision: D15562917 fbshipit-source-id: 6ba44b766f598737bd1a26225034555d2c0358dc
1 parent 8c7886f commit 89446eb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/monitor/connections/flowServerMonitorConnection.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,15 @@ module Make (ConnectionProcessor: CONNECTION_PROCESSOR) : CONNECTION
157157
Lwt.return connection
158158

159159
let catch connection exn =
160-
Logger.error
161-
~exn
162-
"Closing connection '%s' due to uncaught exception in read loop"
163-
connection.name;
160+
(match exn with
161+
| End_of_file ->
162+
Logger.error "Connection '%s' was closed from the other side" connection.name
163+
| _ ->
164+
Logger.error
165+
~exn
166+
"Closing connection '%s' due to uncaught exception in read loop"
167+
connection.name
168+
);
164169
close_immediately connection
165170
end)
166171

0 commit comments

Comments
 (0)