[JAVA-2434] Empty insert causes subsequent queries to hang Created: 27/Jan/17 Updated: 27/Jul/17 Resolved: 22/Feb/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Write Operations |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Stephan Schroevers | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Reproduced against server 3.2.11 and 3.4.1. |
||
| Issue Links: |
|
||||||||||||
| Description |
|
The following test hangs:
The exception associated with the empty insert is:
(I'd argue that an empty insert should just be a NO-OP, but I noticed that MongoCollection#insertMany also throws an IllegalArgumentException on empty input. At the very least the documentation should be clearer on this point. But this is not the primary topic of this ticket.) The second insertion hangs indefinitely. Associated jstack thread dump:
This issue looks similar to |
| Comments |
| Comment by Githook User [ 22/Feb/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Stephan Schroevers [ 27/Jan/17 ] |
|
Alright, I filed |
| Comment by Jeffrey Yemin [ 27/Jan/17 ] |
|
There is some inconsistency between the server, drivers, and the shell in this regard, so feel free to open a ticket. We may end up closing it as Works as Designed, but we should at least track the request separately from this one, as there's a real bug here that we need to fix. |
| Comment by Stephan Schroevers [ 27/Jan/17 ] |
|
Thanks for the rapid response, jeff.yemin!
Indeed, as it stands one should prevent inserting zero documents. But in cases where the list to be inserted is generated dynamically, this can quite easily happen. Is the MongoDB team's official stance on this topic that one should guard all such invocations, or should/can/may I open a separate ticket with a request to have this limitation lifted? |
| Comment by Jeffrey Yemin [ 27/Jan/17 ] |
|
Thanks for reporting this. We've identified the root cause and will get a fix in the next patch release. Given that this bug occurs only in situations that an application must take care to avoid anyway, I'm going to change the priority from Critical to Major. |