Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-25970

SerializedThrowable should record type of the original throwable.

    XMLWordPrintableJSON

Details

    Description

      Currently, only the message and stack of the original throwable is preserved in SerializedThrowable, while the type of the original throwable is discarded.

      Sometimes, it would be helpful if message of SerializedThrowable can also include the full class name of the original throwable.

      E.g., in the following stack.

      Caused by: org.apache.flink.util.SerializedThrowable
          at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) ~[?:1.8.0_102]
          at java.util.HashMap$EntryIterator.next(HashMap.java:1471) ~[?:1.8.0_102]
          at java.util.HashMap$EntryIterator.next(HashMap.java:1469) ~[?:1.8.0_102]
          ...
      

      It's not that easy to understand what is wrong from this stack. JDK does not provide a message for the original exception. We have to look into the JDK source codes to find out what's going on. Sometimes it's even more annoying having to look for the JDK source codes of the exactly same version in order to match the line numbers.

      Turns out the original exception was a ConcurrentModificationException. I think it would be much more straightforward if we can have a stack like the following.

      Caused by: org.apache.flink.util.SerializedThrowable: java.util.ConcurrentModificationException
          at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) ~[?:1.8.0_102]
          at java.util.HashMap$EntryIterator.next(HashMap.java:1471) ~[?:1.8.0_102]
          at java.util.HashMap$EntryIterator.next(HashMap.java:1469) ~[?:1.8.0_102]
          ...
      

      Attachments

        Issue Links

          Activity

            People

              Wencong Liu Wencong Liu
              xtsong Xintong Song
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: