[CSHARP-1129] Ensure there is no memory leak when a ReceiveMessageAsync task is cancelled Created: 21/Nov/14  Updated: 02/Apr/15  Resolved: 24/Nov/14

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: 2.0

Type: Task Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If a ReceiveMessageAsync task is cancelled, the server is still going to eventually send the message, and as currently coded that message will be received and put in the AsyncDropbox.

However, if the ReceiveMessageAsync task has been cancelled then we need to ensure that when the message finally arrives, which is no longer being waited on by anything, it does not get put in the dropbox and stay there forever resulting in a memory leak.

There are multiple ways to resolve this. As long as the unwanted message gets properly disposed of, that's what matters most.



 Comments   
Comment by Githook User [ 24/Nov/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1129: Ensure that cancelling a ReceiveMessageAsync cleanly disposes of the reply message when it eventually arrives.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/f644b285a814f3588ef385838e1b978b654ec5b8

Generated at Wed Feb 07 21:38:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.