Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2411#discussion_r164503277
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java
 ---
    @@ -156,14 +209,23 @@
     
             final List<PropertyDescriptor> _descriptors = new ArrayList<>();
             _descriptors.add(GROK_EXPRESSION);
    +        _descriptors.add(EXPRESSION_SEPARATOR);
             _descriptors.add(GROK_PATTERN_FILE);
             _descriptors.add(DESTINATION);
             _descriptors.add(CHARACTER_SET);
             _descriptors.add(MAX_BUFFER_SIZE);
             _descriptors.add(NAMED_CAPTURES_ONLY);
    +        _descriptors.add(RESULT_PREFIX);
    +        _descriptors.add(BREAK_ON_FIRST_MATCH);
    +        _descriptors.add(MATCHED_EXP_ATTR);
             descriptors = Collections.unmodifiableList(_descriptors);
         }
     
    +    private String resultPrefix = "";
    --- End diff --
    
    This is not thread-safe. Since each invocation of the Processor may use a 
different thread, we must ensure that any member variable is stored in a 
thread-safe manner. Given that these variables appear to be set only in the 
@OnScheduled method and are not mutable objects, it should be sufficient to 
mark them as volatile. It is probably best, though, to move them up in the 
codebase with the other member variables, as that's the de-facto standard with 
nifi processors.


---

Reply via email to