You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Jake Dalli (Jira)" <ji...@apache.org> on 2019/09/23 17:24:00 UTC

[jira] [Created] (NIFI-6701) PublishGCPPubSub does not send all messages

Jake Dalli created NIFI-6701:
--------------------------------

             Summary: PublishGCPPubSub does not send all messages
                 Key: NIFI-6701
                 URL: https://issues.apache.org/jira/browse/NIFI-6701
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 1.9.2
            Reporter: Jake Dalli


I have found an issue with the PublishGCPPubSub processor.  After implementing a number of flows, I have realised that approximately 30% of messages are sporadically not sent to Pubsub in spite of a 'Send Successful' response from the processor. 

 

Upon investigating the code on github  ([https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/pubsub/PublishGCPubSub.java|https://slack-redir.net/link?url=https%3A%2F%2Fgithub.com%2Fapache%2Fnifi%2Fblob%2Fmaster%2Fnifi-nar-bundles%2Fnifi-gcp-bundle%2Fnifi-gcp-processors%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fnifi%2Fprocessors%2Fgcp%2Fpubsub%2FPublishGCPubSub.java]), I found the following issue:
 # On line 163 we get the Future for the 'Publish message' action.
 # On line 165 we have the following loop:

{code:java}
while (messageIdFuture.isDone()) { 
Thread.sleep(500L); 
}
{code}
This means that if the future isDone method returns, the thread sleeps. It is unclear to me why this is the case and I believe this is a bag, in my opinion the processor should sleep if the future is not done, thus the loop should read:
{code:java}
while(!messageIdFuture.isDone()){ ... }{code}
 

 

 

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)