Skip to content

Commit 2998f24

Browse files
committed
Close receiver first in MainDriver close.
I'm speculating there's a race or sequencing problem here that's causing spurious warnings when the receiver loses its connection to the database before it has been closed. Certainly, it can't hurt to shut down the receiver first, then the FormatDriver, before closing the mongoClient.
1 parent 6dedb6b commit 2998f24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bosk-mongo/src/main/java/works/bosk/drivers/mongo/MainDriver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,12 @@ public MongoStatus readStatus() throws Exception {
362362

363363
@Override
364364
public void close() {
365+
receiver.close();
366+
formatDriver.close();
365367
if (!isClosed.getAndSet(true)) {
366368
// It's important we don't call this twice, or else it will throw
367369
mongoClient.close();
368370
}
369-
receiver.close();
370-
formatDriver.close();
371371
}
372372

373373
/**

0 commit comments

Comments
 (0)