Skip to content

Break timer retain cycle #85

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

Merged
merged 1 commit into from
Apr 7, 2025
Merged

Break timer retain cycle #85

merged 1 commit into from
Apr 7, 2025

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Apr 7, 2025

Motivation:

The timers used by the client/server connection management hanlders indirectly hold references to the underlying handler. The hanlder holds a reference to the timer. This cycle isn't broken so a handler is leaked for each connection.

Modifications:

  • Nil out the timers to break the retain cycle when the channel becomes inactive

Result:

Motivation:

The timers used by the client/server connection management hanlders
indirectly hold references to the underlying handler. The hanlder holds
a reference to the timer. This cycle isn't broken so a handler is leaked
for each connection.

Modifications:

- Nil out the timers to break the retain cycle when the channel becomes
  inactive

Result:

- Fewer leaks
- Resolves grpc#84
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Apr 7, 2025
@glbrntt glbrntt requested a review from gjcairo April 7, 2025 12:50
@glbrntt glbrntt mentioned this pull request Apr 7, 2025
@Joannis
Copy link

Joannis commented Apr 7, 2025

Thanks for the quick resolution with this PR!

@glbrntt glbrntt merged commit 9bd1b5b into grpc:main Apr 7, 2025
30 of 31 checks passed
@glbrntt glbrntt deleted the retain-cycle branch April 7, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server transport leaking
3 participants