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

Mark Payne commented on NIFI-883:
---------------------------------

Hey Joe - reading through the code now. I think we can simplify the locking in 
this Processor quite a bit. If we just mark the initializeServer() method as 
synchronized, then we don't really need the lock at all. the 'initialized' flag 
already is an AtomicBoolean, and access to it is thread-safe in the way that it 
is being used. Since this variable is checked within the initializeServer() 
method, if we just make that method synchronized, then we ensure that no two 
threads will be competing to perform the action first.

> HandleHttpRequest starts a web server in the OnScheduled method but should 
> start it in onTrigger
> ------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-883
>                 URL: https://issues.apache.org/jira/browse/NIFI-883
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Mark Payne
>            Assignee: Joseph Percivall
>              Labels: beginner, newbie
>             Fix For: 0.4.0
>
>         Attachments: HttpRequestAndResponseTester.xml, NIFI-883.patch
>
>
> When HandleHttpRequest is scheduled, it creates an embedded jetty web server 
> and starts it. Unfortunately, if this is run in a clustered environment and 
> configured to run on Primary Node Only, all nodes still start the web server. 
> This is very confusing if setting the Hostname property, as other nodes will 
> complain.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to