Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Improve logging in server monitor (mongodb#1060)
Browse files Browse the repository at this point in the history
Log as error any exception except MongoInterruptedException in server monitor
before exiting monitor thread

JAVA-4822
  • Loading branch information
jyemin authored and ispringer committed May 16, 2023
1 parent c5bc06a commit afcb24f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.mongodb.internal.connection;

import com.mongodb.MongoInterruptedException;
import com.mongodb.MongoNamespace;
import com.mongodb.MongoSocketException;
import com.mongodb.ServerApi;
Expand Down Expand Up @@ -179,6 +180,10 @@ public void run() {
}
waitForNext();
}
} catch (MongoInterruptedException e) {
// ignore
} catch (RuntimeException e) {
LOGGER.error(format("Server monitor for %s exiting with exception", serverId), e);
} finally {
if (connection != null) {
connection.close();
Expand Down

0 comments on commit afcb24f

Please sign in to comment.