File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,13 @@ public static class NoMoreConnection extends MongoInternalException {
146
146
147
147
public static class SemaphoresOut extends NoMoreConnection {
148
148
private static final long serialVersionUID = -4415279469780082174L ;
149
+ private static final String message = "Concurrent requests for database connection have exceeded limit" ;
149
150
SemaphoresOut (){
150
- super ( "Out of semaphores to get db connection" );
151
+ super ( message );
152
+ }
153
+
154
+ SemaphoresOut (int numPermits ){
155
+ super ( message + " of " + numPermits );
151
156
}
152
157
}
153
158
@@ -190,7 +195,7 @@ protected int pick( int recommended, boolean couldCreate ){
190
195
public DBPort get () {
191
196
DBPort port = null ;
192
197
if ( ! _waitingSem .tryAcquire () )
193
- throw new SemaphoresOut ();
198
+ throw new SemaphoresOut (_waitingSem . availablePermits () );
194
199
195
200
try {
196
201
port = get ( _options .maxWaitTime );
You can’t perform that action at this time.
0 commit comments