[JAVA-4711] IllegalStateException when trying to create an existing collection Created: 22/Aug/22 Updated: 28/Oct/23 Resolved: 24/Aug/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Reactive Streams |
| Affects Version/s: | 4.7.0 |
| Fix Version/s: | 4.7.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Romain N/A | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Description |
SummaryHello everyone, When attempting to create a new collection when it already exists, an IllegalStateException is thrown, in addition to the usual MongoCommandException. This is a bug since the sync driver only throws the MongoCommandException, and this problem appears with the reactive streams driver since version 4.7.0 only. How to Reproduce
If the collection already exists, you should see this stack trace: https://gist.github.com/Romitou/f552416d07f9608e2ddbecfa5c03e309 Additional BackgroundAs said before, this bug only appears from version 4.7.0 and only on the reactive streams driver, I think this is relevant information. |
| Comments |
| Comment by Githook User [ 24/Aug/22 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Fix double connection release on error for drop and create collection operations (#993)
|
| Comment by Jeffrey Yemin [ 23/Aug/22 ] |
|
Most likely introduced by this commit: https://github.com/mongodb/mongo-java-driver/commit/11484607b8d5f3888f4335f939e02ceb58952eae |
| Comment by Jeffrey Yemin [ 23/Aug/22 ] |
|
Thanks for the report. I was able to reproduce it. It appears that the correct exception is still returned to the caller, but the IllegalStateException is thrown synchronously and logged. It appears to be functionally harmless, but will double-check that. Regardless, it should be fixed as it makes for confusing log messages. |