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

Log exception in user's code

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

      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.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            alien Boris Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: