[JAVA-5109] Try creating tests that verify interruptibility of synchronous MongoClient methods and MongoIterable/MongoCursor methods Created: 15/Aug/23 Updated: 07/Sep/23 Resolved: 01/Sep/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Test Coverage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Valentin Kavalenka | Assignee: | Valentin Kavalenka |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Epic Link: | Virtual Threads Support | ||||||||||||||||
| Quarter: | FY24Q3 | ||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||||||
| Comments |
| Comment by Valentin Kavalenka [ 01/Sep/23 ] | ||||||
|
Note that the test is not in the master branch: https://github.com/mongodb/mongo-java-driver/tree/JAVA_5109. | ||||||
| Comment by Jeffrey Yemin [ 25/Aug/23 ] | ||||||
|
> and I won't continue trying to create tests that we can run as part of our build process, unless the team decides that's what we have to do no matter the cost Unless ross@mongodb.com can think of a cost-effective way to achieve this, I'm in favor also of a standalone project | ||||||
| Comment by Valentin Kavalenka [ 25/Aug/23 ] | ||||||
While I successfully upgraded to Gradle 7.6, I was unable to set up a new Gradle project with tests that would compile and run only if JDK 19+ is used. This is absolute time waste, and I won't continue trying to create tests that we can run as part of our build process, unless the team decides that's what we have to do no matter the cost (https://github.com/stIncMale/mongo-java-driver/tree/JAVA-5109_add_driver-sync-virtual-threads is what I ended up with). Instead, I'll create a standalone project with tests that can be run locally, but not on Evergreen. They'll the driver the way other applications use it. At least this way I can make progress. | ||||||
| Comment by Valentin Kavalenka [ 24/Aug/23 ] | ||||||
|
Socket IO is interruptible if the socket is associated with a SocketChannel (that's not how we create our sockets, because then we would either have to use SSLEngine explicitly, or via a third-party library) or if the IO is done from a virtual thread. This means that the test has to use virtual threads, i.e., it requires either Java SE 19 (https://openjdk.org/jeps/425) or Java SE 20 (https://openjdk.org/jeps/436). According to https://docs.gradle.org/current/userguide/compatibility.html#java, using Java SE 19 requires required Gradle 7.6, and using Java SE 20 requires Gradle 8.3. I tried upgrading Gradle 7.3 to Gradle 8.3, but it is impossible because we use https://plugins.gradle.org/plugin/nebula.optional-base 7.0.0 (the latest at the moment; it allows us to declare optional dependencies without using Gradle feature variants1), which causes Gradle 8.3 to produce
This error happens because the Gradle plugin with the maven id was removed in 8.0, and the plugin with the maven-publish id must be used instead. This removal was announced in Gradle 7.0, but happened only in Gradle 8.0 without further notifications. Apparently, https://plugins.gradle.org/plugin/nebula.optional-base still uses the maven plugin. I now will try upgrading to Gradle 7.6. If I succeed, I should be able to use Java SE 19. 1 I tried declaring an optional org.slf4j:slf4j-api dependency using a feature variant instead of nebula.optional-base. Of course, the project did not even evaluate successfully as a result. |