Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-13467

ThrowableExternalizer cannot handle NullPointerException with cause

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • 15.1.0.Dev06
    • 12.1.7.Final, 13.0.2.Final
    • Core
    • None

      The Reactive Streams spec is very strict about what exceptions can be thrown, so when our blocking executor scheduler throws a CacheBackpressureFullException, RxJava wraps it into a NullPointerException.

      But NullPointerException doesn't have a constructor with a Throwable cause parameter, so RxJava uses initCause(). ThrowableExternalizer sees the cause, doesn't find an appropriate constructor, and gives up.

      Then because the unmarshalling of the ExceptionResponse failed, JGroupsTransport.processResponse() doesn't invoke the ResponseCollector at all, and the request eventually times out.

      Fix steps:

      1. Make CacheBackpressureFullException extend RejectedExecutionException so it's handled more gracefully by RxJava.
      2. Make ThrowableExternalizer use initCause() when a constructor with a cause parameter is not available (or possibly stop unmarshalling the exact exception, see ISPN-12866
      3. Make JGroupsTransport.processResponse() invoke the ResponseCollector with the unmarshalling exception in cases like this.

              Unassigned Unassigned
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: