Skip to content
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

ClientResources.mutate() leads to DefaultClientResources was not shut down properly if the original instance is GC'd #1917

Closed
mp911de opened this issue Nov 22, 2021 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Nov 22, 2021

ClientResources.mutate().build() creates a new instance of client resources and shares its internal state (event loops, shared timer, …). When the original instance gets GC'd, then the shutdown check causes a log event that leaves users under the impression that there was a resource leak.

See also spring-cloud/spring-cloud-sleuth#2059

@mp911de mp911de added the type: bug A general bug label Nov 22, 2021
@mp911de mp911de self-assigned this Nov 22, 2021
@mp911de mp911de added this to the 6.1.6 milestone Nov 22, 2021
mp911de added a commit that referenced this issue Nov 22, 2021
…after mutation #1917

ClientResources now no longer checks if the instance was shut down on finalization to avoid false impression of a resource leak. Typically, the original instance isn't referenced after mutation which allows GC'ing the original resources instance. Because the mutated resource can hold the internal state for thread pool and timer reuse, it is sufficient to close only one instance as long as it shuts down all resources properly.
mp911de added a commit that referenced this issue Nov 22, 2021
Fix invalid javadoc references.
mp911de added a commit that referenced this issue Nov 22, 2021
Move off deprecated Mockito API.
mp911de added a commit that referenced this issue Nov 22, 2021
…after mutation #1917

ClientResources now no longer checks if the instance was shut down on finalization to avoid false impression of a resource leak. Typically, the original instance isn't referenced after mutation which allows GC'ing the original resources instance. Because the mutated resource can hold the internal state for thread pool and timer reuse, it is sufficient to close only one instance as long as it shuts down all resources properly.
mp911de added a commit that referenced this issue Nov 22, 2021
Fix invalid javadoc references.
mp911de added a commit that referenced this issue Nov 22, 2021
Move off deprecated Mockito API.
@mp911de mp911de closed this as completed Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant