[CDRIVER-3195] Driver aborts during bulk write Created: 17/Jun/19 Updated: 06/Apr/23 Resolved: 12/Aug/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Bulk API, libmongoc |
| Affects Version/s: | 1.13.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bh Sr | Assignee: | Kevin Albertson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 10 |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Driver aborts during bulk write because a precondition for "stream" fails.
Here's the callstack.
A few things to note: 1) We only do un-ordered writes. 2) The mongodb server was very busy and probably unresponsive when this happened. 3) My debugger says that error parameter to " _mongoc_stream_writev_full" has domain 2, code 4 and the message "Failed to send "update" command with database "HistoryTest": Failed to read 4 bytes: socket error or timeout". 4) This crash seems to be the same as |
| Comments |
| Comment by Bh Sr [ 13/Aug/19 ] | ||||
|
Thanks Kevin.Albertson! I will test it once 1.15.0 is released. | ||||
| Comment by Kevin Albertson [ 12/Aug/19 ] | ||||
|
Hi srinarasi, we have reproduced a crash for bulk writes using OP_MSG that produces a similar stack trace as you have provided and fixed it as part of Thanks, | ||||
| Comment by Kevin Albertson [ 15/Jul/19 ] | ||||
|
Hi srinarasi I have been able to reproduce this issue, and it appears to still be an issue in master. | ||||
| Comment by Bh Sr [ 02/Jul/19 ] | ||||
|
I meant to say | ||||
| Comment by Bh Sr [ 02/Jul/19 ] | ||||
|
Hi @Kevin Albertson, We have done a couple of changes to the driver. One is to fix
We do use a pooled client. It's difficult to share the code which crashes but in effect, I can represent what we do in the pseudocode below. The pool is created much before this code runs and is not destroyed until much later.
We have not upgraded to 1.14 yet. We have only seen this crash twice in the last few months. So, even if we update in the next few weeks, it may be many many months before it crashes again.
Is there any more information that I can provide? | ||||
| Comment by Kevin Albertson [ 01/Jul/19 ] | ||||
|
Hi srinarasi, thank you for the detailed bug report! Can you reproduce on the latest C driver release, 1.14.0?
Line 433 in 1.13.0 does not correspond to the call to mongoc_stream_writev_full. And 6ade1fe75c is not a known git hash in the C driver. Are you using a modified C driver, and would those modifications be relevant? Is the client you are using a pooled client or single threaded client? If possible, can you provide the relevant part of the code that creates the client and performs the bulk write? |