-
Notifications
You must be signed in to change notification settings - Fork 5k
[Storage] [DataMovement] Setting delegate process to null and objects to null #52994
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
base: main
Are you sure you want to change the base?
Conversation
… chunkhandlers will log unexpected exceptions; remove Transfermanager TransferInternalState reference after transfer completes; Dispose TransferManager in ClientExtensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses potential memory leaks in the Azure Storage DataMovement SDK by implementing proper resource cleanup and disposal patterns. The changes focus on nullifying delegate references and ensuring TransferManager instances are properly disposed.
Key changes:
- Set delegate process to null in ChannelProcessing cleanup to release references
- Set TransferManager reference to null in TransferInternalState after completion
- Updated all test classes to use
await using
pattern for TransferManager disposal
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
TransferInternalState.cs | Nullifies TransferManager reference after transfer completion to release resources |
ChannelProcessing.cs | Sets delegate process to null during cleanup to release references |
DownloadChunkHandler.cs | Improves error handling with proper async/await pattern and logging |
CommitChunkHandler.cs | Improves error handling with proper async/await pattern and logging |
DataMovementEventSource.cs | Adds new event for logging unexpected transfer failures |
Test files (multiple) | Updates all test classes to use await using for proper TransferManager disposal |
Sample and documentation files | Updates examples to use await using pattern for TransferManager |
Part of attempt to resolve potential memory leak and encourage garbage clean up.
Related to #51637