Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4027

Mono#doOnTerminate does not guarantee execution prior to Subscriber notification

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 4.2.0
    • 4.2.2
    • Reactive Streams
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              jeff.yemin@mongodb.com Jeffrey Yemin
              jeff.yemin@mongodb.com Jeffrey Yemin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: