[JAVA-1535] com.mongodb.DBPortPool gotError WARNING: emptying DBPortPool to /ip:port b/c of error Created: 06/Nov/14  Updated: 11/Sep/19  Resolved: 06/Nov/14

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: 2.11.4
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Claire Lee Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: com.mongodb.DBPortPool, connection, socket
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongo-java-driver-2.11.4.jar, Java 8, Tomcat 8, MongoDB 2.6.3



 Description   

My JAVA application is run on Tomcat Server with a single MongoDB. This error occurs some times a day.

  • Here is an exception message.
    ----------------------------------------------------------------------------------------------------
    com.mongodb.DBPortPool gotError
    WARNING: emptying DBPortPool to /172.20.1.4:27017 b/c of error
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:189)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
    at org.bson.io.Bits.readFully(Bits.java:46)
    at org.bson.io.Bits.readFully(Bits.java:33)
    at org.bson.io.Bits.readFully(Bits.java:28)
    at com.mongodb.Response.<init>(Response.java:40)
    at com.mongodb.DBPort.go(DBPort.java:142)
    at com.mongodb.DBPort.call(DBPort.java:92)
    at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
    at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
    at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
    at com.mongodb.DB.command(DB.java:262)
    at com.mongodb.DB.command(DB.java:244)
    at com.mongodb.DBCollection.getCount(DBCollection.java:985)
    at com.mongodb.DBCursor.size(DBCursor.java:602)
    at com.mysema.query.mongodb.MongodbQuery.list(MongodbQuery.java:271)
    at org.springframework.data.mongodb.repository.support.QueryDslMongoRepository.findAll(QueryDslMongoRepository.java:93)
    at sun.reflect.GeneratedMethodAccessor6078.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:358)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at com.sun.proxy.$Proxy586.findAll(Unknown Source)
    ----------------------------------------------------------------------------------------------------
  • The code about connecting MongoDB is not different. Here is the code.

MongoClientOptions options = MongoClientOptions.builder()
.connectionsPerHost(50).build();
MongoClient client = new MongoClient(new ServerAddress(dbHost, dbPort),
Arrays.asList(credential), options);
----------------------------------------------------------------------------------------------------
I can't even guess whether it's caused by a Network problem or a MongoDB java driver.

This issue is really worrying..Please, help me.



 Comments   
Comment by Jeffrey Yemin [ 06/Nov/14 ]

This looks identical to JAVA-1534.

Generated at Thu Feb 08 08:54:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.