-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException in BoundedAsyncPool.createIdle() when availableCapacity=0 #1611
Comments
mp911de
added a commit
that referenced
this issue
Feb 3, 2021
…acity #1611 We now initialize the future array with a completed future instead of leaving the array value null.
mp911de
added a commit
that referenced
this issue
Feb 3, 2021
…acity #1611 We now initialize the future array with a completed future instead of leaving the array value null.
mp911de
added a commit
that referenced
this issue
Feb 3, 2021
…acity #1611 We now initialize the future array with a completed future instead of leaving the array value null.
Thanks for report, that's fixed now. |
Thanks for the quick fix:) |
mp911de
added a commit
that referenced
this issue
Feb 3, 2021
This was referenced Mar 16, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Looks like there's a null pointer exception if createIdle() is called from different threads and availableCapacity becomes 0 while createIdle() is executed.
Current Behavior
The bug appears in the below method and the scenario is described below:
Thread 1: calls createIdle(): toCreate = 1
Thread 2: calls createIdle(): toCreate =1
Thread 1: reaches the line where makeObject0(future); is called
Thread 2: the if(getAvailableCapacity()) returns 0 thus it breaks . That means the futures array will contain one null element
Stack trace
Input Code
Input Code
The code where this NPE is thrown is
Expected behavior/code
There shouldn't be any Exception thrown when the available capacity becomes 0
Environment
Possible Solution
The method with the fix (see changes in between <>)
Additional context
The text was updated successfully, but these errors were encountered: