[JAVA-4027] Mono#doOnTerminate does not guarantee execution prior to Subscriber notification Created: 01/Mar/21 Updated: 28/Oct/23 Resolved: 02/Mar/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Reactive Streams |
| Affects Version/s: | 4.2.0 |
| Fix Version/s: | 4.2.2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The sessions specification requires that an implicit session is available for re-use after the previous operation that is using it completes. Currently, we rely on the use of Mono:doOnTerminate to help provide that guarantee, as in current versions of Project Reactor there is a documented guarantee that the termination code will execute prior to Subscriber notification. But that guarantee is not included, and is violated, in the current minimum release of Project Reactor that we support (Californium). Therefore, until we update our minimum supported Project Reactor release, we should ensure that the driver behaves consistently and as expected when using that release. This is easy to do: instead of releasing the binding via Mono#doOnTerminate, wrap the sinkToCallback in another callback that releases the binding before notifying the Sink of completion. |
| Comments |
| Comment by Githook User [ 02/Mar/21 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Ensure that AsyncReadWriteBinding is released prior to subscriber notification (#676) Previously the driver assumed that Mono#doOnTerminate is executed
|
| Comment by Githook User [ 02/Mar/21 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Ensure that AsyncReadWriteBinding is released prior to subscriber notification (#676) Previously the driver assumed that Mono#doOnTerminate is executed
|