hi,recently i found our application appear “the mongo client connect will be closed” alarm and lead crud operation error. so i check the pool settings and found no customize setting but use the default pool settings. the follow code :
public static final class Builder {
private List<ConnectionPoolListener> connectionPoolListeners = new ArrayList<ConnectionPoolListener>();
private int maxSize = 100;
private int minSize;
private int maxWaitQueueSize = 500;
private long maxWaitTimeMS = 1000 * 60 * 2;
private long maxConnectionLifeTimeMS;
private long maxConnectionIdleTimeMS;
private long maintenanceInitialDelayMS;
private long maintenanceFrequencyMS = MILLISECONDS.convert(1, MINUTES);
Builder() {
}
maxConnectionLifeTimeMS and maxConnectionIdleTimeMS default=0 ,A zero value indicates no limit to the life time i guess that once the connect is bad the pool did not destroy it ,so appear the above problem. whether set a reasonable none zero value is a good idea? thanks.
Comment From: snicoll
whether set a reasonable none zero value is a good idea?
I don't know but that code is from MongoDB so that's a question you should be asking them. I am going to close this now but we can reopen if it turns out some work in Spring Boot is necessary.
Comment From: lmx1989219
whether set a reasonable none zero value is a good idea?
I don't know but that code is from MongoDB so that's a question you should be asking them. I am going to close this now but we can reopen if it turns out some work in Spring Boot is necessary.
thanks for your help