You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2018/11/07 17:18:00 UTC

[jira] [Resolved] (AVRO-2051) Thread contention accessing JsonProperties props

     [ https://issues.apache.org/jira/browse/AVRO-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved AVRO-2051.
-------------------------------
       Resolution: Fixed
         Assignee: Daniel Kulp
    Fix Version/s: 1.9.0

> Thread contention accessing JsonProperties props
> ------------------------------------------------
>
>                 Key: AVRO-2051
>                 URL: https://issues.apache.org/jira/browse/AVRO-2051
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Daniel Kulp
>            Assignee: Daniel Kulp
>            Priority: Major
>             Fix For: 1.9.0
>
>
> See https://lists.apache.org/thread.html/dd34ab8439137a81a9de29ad4161f37b17638394cea0806765689976@%3Cuser.avro.apache.org%3E
> Basically, the getJsonProp method, being synchronized, is causing thread contention issues when trying to share schemas between threads.    My proposal (pull request forthcoming) is to treat "props" as an immutable map and do a copy+add+swap for the addProp method.   This will make the addProp call slower (particularly for large maps of props), but would make the reads significantly faster as no locking will be needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)