Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-914

SpecificResponder casts Throwable to Exception; fails for OutOfMemoryError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.0
    • java
    • None

    Description

      I have the following stack frame in an application i'm working with:

      java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception
      at org.apache.avro.ipc.specific.SpecificResponder.respond(SpecificResponder.java:90)
      at org.apache.avro.ipc.Responder.respond(Responder.java:149)
      at org.apache.avro.ipc.SocketServer$Connection.run(SocketServer.java:116)
      at java.lang.Thread.run(Thread.java:662)

      Nothing too surprising, here's the code:

        @Override
        public Object respond(Message message, Object request) throws Exception {
      ...
          } catch (InvocationTargetException e) {
            throw (Exception)e.getTargetException();
      ...
      

      It's probably a bug that this ends up with a ClassCastException. Any suggestions? I don't think we can change the signature to Exception. We could check instanceof and wrap the Throwable if it's not an Exception?

      Attachments

        1. AVRO-914.patch.txt
          0.9 kB
          Philip Martin

        Issue Links

          Activity

            People

              philip Philip Martin
              philip Philip Martin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: