[ 
https://issues.apache.org/jira/browse/NIFI-4215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16109209#comment-16109209
 ] 

Wesley L Lawrence commented on NIFI-4215:
-----------------------------------------

[~markap14] If the 'fields' and 'fieldIndices' are private (but not final) to 
'SimpleRecordSchema', and 'fields' is still a 'Collections.unmodifiableList', 
and 'fieldIndices' isn't available outside the class, what can be mutated from 
outside 'SimpleRecordSchema'? While I agree that ideally they should also be 
final, the fact that they aren't mutable outside the 'SimpleRecordSchema', and 
that 'SimpleRecordSchema' currently doesn't mutate them (apart from a one-time 
'setFields' call, which throws an exception if used a second time) should be 
enough to maintain thread safety.

--Wes

> Avro schemas with records that have a field of themselves fail to parse, 
> causing stackoverflow exception
> --------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-4215
>                 URL: https://issues.apache.org/jira/browse/NIFI-4215
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Wesley L Lawrence
>            Priority: Blocker
>             Fix For: 1.4.0
>
>         Attachments: nifi-4215.patch
>
>
> Noticed this while attempting to use the AvroSchemaRegsitry with some complex 
> schema. Boiled down, Avro lets you define a schema such as;
> {code}
> { 
>   "namespace": "org.apache.nifi.testing", 
>   "name": "CompositRecord", 
>   "type": "record", 
>   "fields": [ 
>     { 
>       "name": "id", 
>       "type": "int" 
>     }, 
>     { 
>       "name": "value", 
>       "type": "string" 
>     }, 
>     { 
>       "name": "parent", 
>       "type": [
>         "null",
>         "CompositRecord"
>       ]
>     } 
>   ] 
> }
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to