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

Log exception in user's code

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11.0
    • Component/s: Async, Error Handling
    • Labels:
      None

      Description

      Ensure exceptions calling onError|onComplete log if the Publisher already considers itself terminal.

      In the scenario where onComplete errors, then onError won't be called as the Publisher has marked itself as terminated. The error should be logged to help debugging.

      Was:

      I'm using the "mongodb-driver-reactivestreams" driver versionĀ 1.11.0.

      An exception is thrown in our code which propagates all the way to "AbstractSubscription.tryProcessResultsQueue" on line 161 where "onError" is called but in it the "terminalAction()" check returns "false" so "observer.onError(t)" is not called. Actually neither is "observer.onComplete()".

      This is definitely a bug, at least one of the two should be called and, of course, in this case "onError" should be.

      If it is not obvious to you what's going on, I could try creating a reproduction but this will take a while.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: