File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -455,11 +455,18 @@ public String debugString(){
455
455
456
456
public void close (){
457
457
_closed = true ;
458
- if ( _portHolder != null )
458
+ if ( _portHolder != null ) {
459
459
_portHolder .close ();
460
- if ( _rsStatus != null )
460
+ _portHolder = null ;
461
+ }
462
+ if ( _rsStatus != null ) {
461
463
_rsStatus .close ();
462
- _myPort = null ;
464
+ _rsStatus = null ;
465
+ }
466
+
467
+ // below this will remove the myport for this thread only
468
+ // client using thread pool in web framework may need to call close() from all threads
469
+ _myPort .remove ();
463
470
}
464
471
465
472
/**
@@ -500,7 +507,7 @@ public int getMaxBsonObjectSize() {
500
507
private DBPortPool _masterPortPool ;
501
508
private DBPortPool .Holder _portHolder ;
502
509
private final List <ServerAddress > _allHosts ;
503
- private final ReplicaSetStatus _rsStatus ;
510
+ private ReplicaSetStatus _rsStatus ;
504
511
private boolean _closed = false ;
505
512
private int maxBsonObjectSize = 0 ;
506
513
You can’t perform that action at this time.
0 commit comments