Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-7843

Recursive avro schemas fail to write with RecordWriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.13.0
    • None
    • None

    Description

      Recursive Avro record with a schema containing self-reference cannot be written by RecordWriter due to infinite loop / StackOverflowError.

      Schema:

      {
        "namespace": "dataformat.avro.recursive",  
        "type": "record",  
        "name": "PersonRecursive",  
        "fields": [
          {"name": "id", "type": "int"},
          {"name": "name",  "type": ["string", "null"]},
          {"name": "parent",  "type": ["PersonRecursive", "null"]}  
        ]
      } 

      Exception:

      2020-09-24 06:13:21,978 ERROR [Timer-Driven Process Thread-7] o.a.n.processors.standard.ConvertRecord ConvertRecord[id=b666a7ea-0174-1000-894b-7b743c091dc0] ConvertRecord[id=b666a7ea-0174-1000-894b-7b743c091dc0] failed to process session due to java.lang.StackOverflowError; Processor Administratively Yielded for 1 sec: java.lang.StackOverflowError
      java.lang.StackOverflowError: null
              at java.base/java.util.Objects.equals(Objects.java:77)
              at org.apache.nifi.serialization.record.type.RecordDataType.equals(RecordDataType.java:61)
              at org.apache.nifi.serialization.record.RecordField.equals(RecordField.java:130)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at java.base/java.util.ArrayList.equalsRange(ArrayList.java:574)
              at java.base/java.util.ArrayList.equals(ArrayList.java:561)
              at java.base/java.util.Collections$UnmodifiableList.equals(Collections.java:1307)
              at org.apache.nifi.serialization.SimpleRecordSchema.equals(SimpleRecordSchema.java:175)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at org.apache.nifi.serialization.record.type.RecordDataType.equals(RecordDataType.java:61)
              at org.apache.nifi.serialization.record.RecordField.equals(RecordField.java:130)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at java.base/java.util.ArrayList.equalsRange(ArrayList.java:574)
              at java.base/java.util.ArrayList.equals(ArrayList.java:561)
              at java.base/java.util.Collections$UnmodifiableList.equals(Collections.java:1307)
              at org.apache.nifi.serialization.SimpleRecordSchema.equals(SimpleRecordSchema.java:175)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at org.apache.nifi.serialization.record.type.RecordDataType.equals(RecordDataType.java:61)
              at org.apache.nifi.serialization.record.RecordField.equals(RecordField.java:130)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at java.base/java.util.ArrayList.equalsRange(ArrayList.java:574)
              at java.base/java.util.ArrayList.equals(ArrayList.java:561)
              at java.base/java.util.Collections$UnmodifiableList.equals(Collections.java:1307)
              at org.apache.nifi.serialization.SimpleRecordSchema.equals(SimpleRecordSchema.java:175)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at org.apache.nifi.serialization.record.type.RecordDataType.equals(RecordDataType.java:61)
              at org.apache.nifi.serialization.record.RecordField.equals(RecordField.java:130)
              at java.base/java.util.Objects.equals(Objects.java:77)
              at java.base/java.util.ArrayList.equalsRange(ArrayList.java:574)
              at java.base/java.util.ArrayList.equals(ArrayList.java:561) 

      Attachments

        Issue Links

          Activity

            People

              denes Denes Arvay
              denes Denes Arvay
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h