[CSHARP-164] MongoConnectionPool - Object reference not set to instance of object Created: 01/Feb/11 Updated: 02/Apr/15 Resolved: 15/Mar/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Joe Seymour | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 x64 |
||
| Description |
|
When closing a connection, getting "Object reference not set to instance of object". It's coming from MongoConnecitonPool.ReleaseConnection(MongoConnection connection): connection.LastUsedAt = DateTime.UtcNow; Looks like this is getting called after the close method, which sets the availableConnections to null. I assume at this point that the connection is just being abandoned, and has already been close, I added an if statement to my code to make sure availableConnections wasn't null before adding it back to the pool. Not sure if that's the right answer. |
| Comments |
| Comment by Robert Stam [ 15/Mar/11 ] |
|
Was unable to reproduce but by inspection of the code there appeared to be some possible race conditions between threads. |
| Comment by Robert Stam [ 01/Feb/11 ] |
|
Your comments make sense. Can this be easily reproduced? Do you have a stack trace? |