File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
driver-core/src/main/com/mongodb/connection Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ protected void connect() {
93
93
94
94
@ Override
95
95
public void close () {
96
- if (! isClosed () ) {
97
- synchronized ( this ) {
96
+ synchronized ( this ) {
97
+ if (! isClosed () ) {
98
98
for (final ServerTuple serverTuple : addressToServerTupleMap .values ()) {
99
99
serverTuple .server .close ();
100
100
}
@@ -123,12 +123,12 @@ public void stateChanged(final ChangeEvent<ServerDescription> event) {
123
123
}
124
124
125
125
private void onChange (final ChangeEvent <ServerDescription > event ) {
126
- if (isClosed ()) {
127
- return ;
128
- }
129
-
130
126
boolean shouldUpdateDescription = true ;
131
127
synchronized (this ) {
128
+ if (isClosed ()) {
129
+ return ;
130
+ }
131
+
132
132
ServerDescription newDescription = event .getNewValue ();
133
133
134
134
if (LOGGER .isTraceEnabled ()) {
You can’t perform that action at this time.
0 commit comments