[JAVA-3710] sporadic "com.mongodb.MongoException: state should be: open" Created: 15/Apr/20 Updated: 28/Oct/23 Resolved: 15/Jun/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Async |
| Affects Version/s: | 2.8.0 |
| Fix Version/s: | 3.12.6, 4.0.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Yann Simon | Assignee: | John Stewart (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
We are using a mongo query Observable, converted to a reactive stream Publisher based on this code: https://github.com/mongodb/mongo-scala-driver/blob/master/examples/src/test/scala/reactivestreams/Implicits.scala By using this in a akka-stream flow, we have this error: The mongo scala driver is using the java driver mongodb-driver-async in the version 3.12.2. We had this issue also with older versions. We tried updating without any success. Any hint would be helpful. I see that there is now a reactive driver but might not have this issue. We cannot upgrade now but might consider this in the future. I'll looking for ways to fix the issue with the current drivers. |
| Comments |
| Comment by Yann Simon [ 24/Jul/20 ] | ||||||||||||||||||||||||||||||||||||
|
I can confirm this issue is fixed.
We are using the mongo scala driver that is still using an older version of mongodb-driver-async. https://search.maven.org/artifact/org.mongodb.scala/mongo-scala-driver_2.13/2.9.0/jar So we had to force an update of this transitive dependency. Thanks a lot for the fix!
It'd be great to update the dependencies of the mongo scala driver so that users can profit from the fix automatically. | ||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 08/Jul/20 ] | ||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'John Stewart', 'email': 'john.stewart@mongodb.com', 'username': 'jstewart-mongo'}Message: Avoid calling batch cursor when the cursor is closed
| ||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 30/Jun/20 ] | ||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'John Stewart', 'email': 'john.stewart@mongodb.com', 'username': 'jstewart-mongo'}Message: Avoid calling batch cursor when the cursor is closed
| ||||||||||||||||||||||||||||||||||||
| Comment by Yann Simon [ 15/Jun/20 ] | ||||||||||||||||||||||||||||||||||||
|
Thx for the fix! Will it be backported in the 3.x branch? | ||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 15/Jun/20 ] | ||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'John Stewart', 'email': 'john.stewart@mongodb.com', 'username': 'jstewart-mongo'}Message: Avoid calling batch cursor when the cursor is closed
| ||||||||||||||||||||||||||||||||||||
| Comment by John Stewart (Inactive) [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
yann.simon.fr@gmail.com It is a change that needs to be implemented in the driver. | ||||||||||||||||||||||||||||||||||||
| Comment by Yann Simon [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
Thx for the quick feedback. Is it a change I could do myself, for example in the [ObservableToPublisher|https://github.com/mongodb/mongo-scala-driver/blob/master/examples/src/test/scala/reactivestreams/Implicits.scala?] Or is it a change that has to be done in the driver itself? | ||||||||||||||||||||||||||||||||||||
| Comment by John Stewart (Inactive) [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
yann.simon.fr@gmail.com The fix found in | ||||||||||||||||||||||||||||||||||||
| Comment by Yann Simon [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
For info, I've tried to use monix instead of akka-stream to check if that can fix the issue. But sadly the issue is still occuring. | ||||||||||||||||||||||||||||||||||||
| Comment by Yann Simon [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
Today we had a similar issue:
by using ".toFuture()" The calling code:
| ||||||||||||||||||||||||||||||||||||
| Comment by Yann Simon [ 30/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
Thx for the update. https://jira.mongodb.org/browse/JAVA-3487 is fixed in 3.12.1 We are already using org.mongodb:mongodb-driver-async:3.12.2
| ||||||||||||||||||||||||||||||||||||
| Comment by John Stewart (Inactive) [ 29/Apr/20 ] | ||||||||||||||||||||||||||||||||||||
|
The fix will be similar to the one found in |