[JAVA-5242] Close StreamFactoryFactory when closing sync MongoClient similarly to how its done via reactive MongoClientImpl.externalResourceCloser Created: 14/Nov/23 Updated: 20/Nov/23 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Valentin Kavalenka | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
|
The driver uses NettyStreamFactoryFactory if NettyTransportSettings is specified regardless of whether the sync or reactive API is used. Currently, only the reactive MongoClient closes NettyStreamFactoryFactory, which means that NettyStreamFactoryFactory.eventLoopGroup leaks if NettyTransportSettings is specified and the sync MongoClient is used. There seem to be reasons for specifying NettyTransportSettings when using the sync API, which means we should also close NettyStreamFactoryFactory via the sync MongoClient. |