[ https://issues.apache.org/jira/browse/NIFI-6701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre Villard reassigned NIFI-6701: ------------------------------------ Assignee: Pierre Villard > 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 > Assignee: Pierre Villard > Priority: Major > Labels: easyfix > Time Spent: 50m > Remaining Estimate: 0h > > 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)