You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Iván Ezequiel Rodriguez (JIRA)" <ji...@apache.org> on 2019/06/26 04:42:00 UTC

[jira] [Issue Comment Deleted] (NIFI-6395) CountText processor is not thread safe - concurrency error

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

Iván Ezequiel Rodriguez updated NIFI-6395:
------------------------------------------
    Comment: was deleted

(was: [https://github.com/apache/nifi/pull/3549/commits/86c6ef7ce84089055f26aca68ea996c6735f7c0a|http://example.com])

> CountText processor is not thread safe - concurrency error
> ----------------------------------------------------------
>
>                 Key: NIFI-6395
>                 URL: https://issues.apache.org/jira/browse/NIFI-6395
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.9.2
>         Environment: software platform
>            Reporter: Iván Ezequiel Rodriguez
>            Priority: Major
>              Labels: concurrency, count, error, processor, text, thread-safe
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The processor counters fail to execute multiple threads. The programming is not safe since they are not atomic operations. They are using a volatile instance variable accessed by multiple threads when onTrigger is called. The solution is to declare those local variables to onTrigger. Perform several tests with millions of records and the counter does not work correctly when it is executed with more than one task.
> The problem is in the declaration of these instance variables:
> private *volatile int* lineCount;
> private *volatile int* lineNonEmptyCount;
> private *volatile int* wordCount;
> private *volatile int* characterCount;
> This is not safe to perform atomic operations on these variables. As a result the counters register less amount of lines when executed with multiple threads.
> I propose the following solution:
> [Fix bug pull request|https://github.com/apache/nifi/pull/3550]



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