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

Avro schemas with records that have a field of themselves fail to parse, causing stackoverflow exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.0
    • 1.4.0
    • None
    • None

    Description

      Noticed this while attempting to use the AvroSchemaRegsitry with some complex schema. Boiled down, Avro lets you define a schema such as;

      { 
        "namespace": "org.apache.nifi.testing", 
        "name": "CompositRecord", 
        "type": "record", 
        "fields": [ 
          { 
            "name": "id", 
            "type": "int" 
          }, 
          { 
            "name": "value", 
            "type": "string" 
          }, 
          { 
            "name": "parent", 
            "type": [
              "null",
              "CompositRecord"
            ]
          } 
        ] 
      }
      

      The AvroSchemaRegistry (AvroTypeUtil specifically) will fail to parse, and generate a stackoverflow exception.

      I've whipped up a fix, tested it out in 1.4.0, and am just running through the contrib build before I submit a patch.

      Attachments

        1. nifi-4215.patch
          20 kB
          Wesley L Lawrence

        Activity

          People

            Unassigned Unassigned
            WesleyLawrence Wesley L Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: