avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiruvalluvan M. G. (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1055) Race condition in Java fingerprinting code
Date Sat, 07 Apr 2012 12:25:17 GMT

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

Thiruvalluvan M. G. updated AVRO-1055:

    Attachment: AVRO-1055.patch

This patch solves the problem by making the FP table a static array and initializing it in
a static block. Java ensures that nobody is able to access the table until it is fully initialized.

By making it a static member of an inner static class rather than SchemaNormalization class
itself, we ensure that the Table is initialized only when it is required. (the class loader
will load the inner class only when the table is accessed for the first time)
> Race condition in Java fingerprinting code
> ------------------------------------------
>                 Key: AVRO-1055
>                 URL: https://issues.apache.org/jira/browse/AVRO-1055
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Thiruvalluvan M. G.
>            Assignee: Thiruvalluvan M. G.
>            Priority: Minor
>         Attachments: AVRO-1055.patch
> There is a subtle race condition. If the fpTable64 is not yet initialized and two thread
try to compute FP for two schemas (or the same schema) at the same time, one thread will start
initializing the table while the other can start using the partially initialized table giving
wrong result.
> The forthcoming patch fixes that issue

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message