You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by olegz <gi...@git.apache.org> on 2016/07/08 13:40:42 UTC

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

GitHub user olegz opened a pull request:

    https://github.com/apache/nifi/pull/618

    NIFI-2192 fixed OOM issue in KafkaPublisher

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/olegz/nifi NIFI-2192

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/618.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #618
    
----
commit 558f6dac92a31409b86d31f4e9913068be514ac9
Author: Oleg Zhurakousky <ol...@suitcase.io>
Date:   2016-07-08T12:22:24Z

    NIFI-2192 fixed OOM issue in KafkaPublisher

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/618


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on the issue:

    https://github.com/apache/nifi/pull/618
  
    @olegz made a few inline comments, but otherwise, all looks good! After you've updated the PR let me know and i'll merge to 0.x and master. Thanks for jumping in here and getting this squared away!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/618#discussion_r70126630
  
    --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-pubsub-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/KafkaPublisher.java ---
    @@ -100,15 +107,31 @@ KafkaPublisherResult publish(PublishingContext publishingContext) {
     
             byte[] messageBytes;
             int tokenCounter = 0;
    -        for (; (messageBytes = streamTokenizer.nextToken()) != null; tokenCounter++) {
    +        boolean continueSending = true;
    +        KafkaPublisherResult result = null;
    +        for (; (messageBytes = streamTokenizer.nextToken()) != null && continueSending; tokenCounter++) {
    --- End diff --
    
    Agreed!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/618#discussion_r70124648
  
    --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java ---
    @@ -114,10 +121,13 @@ KafkaPublisherResult publish(PublishingContext publishingContext) {
     
             int prevLastAckedMessageIndex = publishingContext.getLastAckedMessageIndex();
             List<Future<RecordMetadata>> resultFutures = new ArrayList<>();
    +        System.out.println(1 - prevLastAckedMessageIndex);
     
             byte[] messageBytes;
             int tokenCounter = 0;
    -        for (; (messageBytes = streamTokenizer.nextToken()) != null; tokenCounter++) {
    +        boolean continueSending = true;
    +        KafkaPublisherResult result = null;
    +        for (; (messageBytes = streamTokenizer.nextToken()) != null && continueSending; tokenCounter++) {
    --- End diff --
    
    Should we change the conditional here to `continueSending && (messageBytes = streamTokenizer.nextToken()) != null` so that we don't bother calling streamTokenizer.nextToken() if `continueSending` is false?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/618#discussion_r70117429
  
    --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java ---
    @@ -114,10 +121,13 @@ KafkaPublisherResult publish(PublishingContext publishingContext) {
     
             int prevLastAckedMessageIndex = publishingContext.getLastAckedMessageIndex();
             List<Future<RecordMetadata>> resultFutures = new ArrayList<>();
    +        System.out.println(1 - prevLastAckedMessageIndex);
    --- End diff --
    
    I think this was supposed to be removed before the PR, no?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on the issue:

    https://github.com/apache/nifi/pull/618
  
    @markap14 all done, thanks for reviewing. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by markap14 <gi...@git.apache.org>.
Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/618#discussion_r70125032
  
    --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-pubsub-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/KafkaPublisher.java ---
    @@ -100,15 +107,31 @@ KafkaPublisherResult publish(PublishingContext publishingContext) {
     
             byte[] messageBytes;
             int tokenCounter = 0;
    -        for (; (messageBytes = streamTokenizer.nextToken()) != null; tokenCounter++) {
    +        boolean continueSending = true;
    +        KafkaPublisherResult result = null;
    +        for (; (messageBytes = streamTokenizer.nextToken()) != null && continueSending; tokenCounter++) {
    --- End diff --
    
    Would recommend switching the orders of the conditions here, as mentioned above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #618: NIFI-2192 fixed OOM issue in KafkaPublisher

Posted by olegz <gi...@git.apache.org>.
Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/618#discussion_r70122001
  
    --- Diff: nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java ---
    @@ -114,10 +121,13 @@ KafkaPublisherResult publish(PublishingContext publishingContext) {
     
             int prevLastAckedMessageIndex = publishingContext.getLastAckedMessageIndex();
             List<Future<RecordMetadata>> resultFutures = new ArrayList<>();
    +        System.out.println(1 - prevLastAckedMessageIndex);
    --- End diff --
    
    Yep, i'll wait till you all done and will address this and whatever others in one shot


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---