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

Martin Tzvetanov Grigorov commented on AVRO-4078:
-------------------------------------------------

You can't push to repositories you do now own or be a member of!

In such cases you have to create a Pull Request.

[https://github.com/apache/avro/pull/3216] - here is a PR with the classes from 
the reproducer.

The test case passes for both 1.11.5-SNAPSHOT (branch "branch-1.11") and 
1.13.0-SNAPSHOT (branch "main").

The reproducer (your Github project) fails for 1.11.4 but passes for 1.12.0.

If I comment out the WRITER$/READER$ static fields in FullName.java then it 
passes for 1.11.4 as well.

> RecursiveUpdate error loading schema 
> -------------------------------------
>
>                 Key: AVRO-4078
>                 URL: https://issues.apache.org/jira/browse/AVRO-4078
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.11.3
>         Environment: java version 11
> avro version 1.11.4 and 1.11.3
>  
>            Reporter: prashant sharma
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I think there is an issue in avro versions (1.10+) onwards caused by MapUtil 
> class
> ([https://github.com/apache/avro/blob/main/lang/java/avro/src/main/java/org/apache/avro/util/MapUtil.java])
>  
>  [https://github.com/pacificmist0900/avro] 
> Expected no exception to be thrown, but got 
> 'java.lang.ExceptionInInitializerError'
>  
> Caused by: java.lang.ExceptionInInitializerError
> at java.base/java.lang.Class.forName(Class.java:398)
> at org.apache.avro.util.ClassUtils.forName(ClassUtils.java:95)
> at org.apache.avro.util.ClassUtils.forName(ClassUtils.java:72)
> at 
> org.apache.avro.specific.SpecificData.lambda$getClass$2(SpecificData.java:259)
> at 
> java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
> at org.apache.avro.util.MapUtil.computeIfAbsent(MapUtil.java:42)
> at org.apache.avro.specific.SpecificData.getClass(SpecificData.java:257)
> Caused by: java.lang.IllegalStateException: Recursive update
> at 
> java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1760)
> at org.apache.avro.util.MapUtil.computeIfAbsent(MapUtil.java:42)
> at org.apache.avro.specific.SpecificData.getClass(SpecificData.java:257)
> at org.apache.avro.specific.SpecificData.getForSchema(SpecificData.java:164)
> at 
> org.apache.avro.specific.SpecificDatumWriter.<init>(SpecificDatumWriter.java:47)
> ... 8 more
>  
> If I use avro version 1.9 (which doesn't have MapUtil) my test works.
>  
>  
> P.S - we are migrating our services(that uses kafka and avro schema) from 1.9 
> to 1.11.4 as there has been a critical vulnerability reported in avro 
> ([https://security.snyk.io/vuln/SNYK-JAVA-ORGAPACHEAVRO-8161188]) , But we 
> can't do it as avro 1.11.* fails for us due to above issue. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to