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