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(){
455455
456456 public void close (){
457457 _closed = true ;
458- if ( _portHolder != null )
458+ if ( _portHolder != null ) {
459459 _portHolder .close ();
460- if ( _rsStatus != null )
460+ _portHolder = null ;
461+ }
462+ if ( _rsStatus != null ) {
461463 _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 ();
463470 }
464471
465472 /**
@@ -500,7 +507,7 @@ public int getMaxBsonObjectSize() {
500507 private DBPortPool _masterPortPool ;
501508 private DBPortPool .Holder _portHolder ;
502509 private final List <ServerAddress > _allHosts ;
503- private final ReplicaSetStatus _rsStatus ;
510+ private ReplicaSetStatus _rsStatus ;
504511 private boolean _closed = false ;
505512 private int maxBsonObjectSize = 0 ;
506513
You can’t perform that action at this time.
0 commit comments