[JAVA-4523] Buffer is leaked from buffer pool on socket exception Created: 08/Mar/22 Updated: 28/Oct/23 Resolved: 10/Mar/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Internal |
| Affects Version/s: | None |
| Fix Version/s: | 4.6.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
In SocketStream#read, the ByteBuf is not released if an exception is thrown. As a result the buffer will be GC'd but will not be returned to the buffer pool. This is a performance issue, but also a correctness issue, as it will result in a permit never being released. Eventually, an application could run out of permits (although currently there are Integer#MAX_VALUE permits available so it's unlikely. |
| Comments |
| Comment by Githook User [ 10/Mar/22 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Ensure buffer is released on exception in SocketStream#read (#888)
|