[JAVA-2661] Avoid interruption exception in tryAcquire when there is no wait. Created: 13/Nov/17  Updated: 27/Oct/23  Resolved: 28/Nov/17

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 3.5.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When using the mongo-java-driver-reactivestream with RxJava2, sometimes the driver throws MongoInterruptedException due to RxJava2 interrupts the thread when disposed. See discussion on the RxJava2 side: ReactiveX/RxJava#5711

RxJava developers recommend the callbacks should not be interrupt sensitive. By changing the tryAcquire(0, TimeUnit) to tryAcquire(), it would not throw InterruptedException.

PR: https://github.com/mongodb/mongo-java-driver/pull/428


Generated at Thu Feb 08 08:57:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.