[GODRIVER-791] Panic on cursor Close with a dead server Created: 29/Jan/19 Updated: 28/Oct/23 Resolved: 01/Feb/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Error Handling |
| Affects Version/s: | 0.0.2 |
| Fix Version/s: | 0.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ryan Wynn | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux |
||
| Description |
|
Received the following panic when doing some negative testing. This seems to have occurred when Close() was called on a cursor after Next() returned false. I started a long running query with MongoDB running and brought mongod down in the middle of it returning results. So mongod was down at the time of the Close call. panic: runtime error: invalid memory address or nil pointer dereference |
| Comments |
| Comment by Githook User [ 01/Feb/19 ] |
|
Author: {'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}Message: Fix cursor types and implement BatchCursor
Change-Id: I7d4121e7fffcfadd7427a6fc64d97d4c131acbbe |
| Comment by Ryan Wynn [ 29/Jan/19 ] |
|
Also, when the heartbeat fails to get server info, it still returns server info that is truncated to the basics. https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/server.go#L437 But I think that will cause problems because that basic info doesn't include a bunch of things like the wire version... https://github.com/mongodb/mongo-go-driver/blob/master/x/network/description/server.go#L30
|
| Comment by Ryan Wynn [ 29/Jan/19 ] |
|
I think maybe the description updates should all be guarded by nil checks https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/server.go#L333 Some of the updateDescription calls in this file check for nil before setting, but others do not. |