[CSHARP-717] If the driver tries to read from a socket that the server has closed it will hang Created: 01/Apr/13  Updated: 20/Mar/14  Resolved: 01/Apr/13

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8
Fix Version/s: 1.8.1

Type: Bug Priority: Blocker - P1
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

This is a regression from 1.7. Parts of the low level IO methods were rewritten and they are not properly throwing an EndOfStreamException (as 1.7 did) when the server closes the socket.



 Comments   
Comment by Robert Stam [ 25/Apr/13 ]

Thanks for the update.

Comment by guy pitelko [ 25/Apr/13 ]

At the moment it doesn't seem like the problem we had originated from the mongo c# driver. We've found a stack-overflow exception in another library that was working in parallel. Once it has been disabled the app is running without problems.

Comment by Sridhar Nanjundeswaran [ 22/Apr/13 ]

Just an FYI. I am unable to repro with 1.8.1 with the following 2 types of tests
1) Insert into a collection, issue shutdown from code, wait in debugger and then issue a find. I get the expected MongoConnectionException
2) Insert into a collection, now shutdown the server via mongo shell and then issue a find (paused in debugger). I get the expected socket exception.
Both tests were with 2.4.1 stand alone instance.

Comment by guy pitelko [ 21/Apr/13 ]

Trying to reproduce in dev-env with the driver's source code compiled with the project, will update if I find it.

Comment by Robert Stam [ 20/Apr/13 ]

Sorry for your frustration. Is there any additional information you can provide that would help us resolve your issue? Ideally a stack trace (if it's in an infinite loop you would have to run using a debugger and hit break so see where it is), or at least the name of the method that is hanging and whether there are any error messages in the server log at the same time.

Comment by guy pitelko [ 20/Apr/13 ]

The issue seems not resolved.
I've upgraded from 1.8 to 1.8.1 and driver still hangs. Frustrating. Maybe should revert to 1.7 instead.

Comment by auto [ 01/Apr/13 ]

Author:

{u'date': u'2013-04-01T15:51:51Z', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-717: Fix regression where reading from a socket that has been closed by the server is now hanging instead of throwing an EndOfStreamException.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/92b8bde6932fa47ab1edb69b9cdb70386c6353bf

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