You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by markap14 <gi...@git.apache.org> on 2016/07/28 14:20:15 UTC

[GitHub] nifi pull request #734: NIFI-2395: Ensure that if we fail to index provenanc...

GitHub user markap14 opened a pull request:

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

    NIFI-2395: Ensure that if we fail to index provenance events we do not \u2026

    \u2026prevent the repo from continuing to merge journals

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

    $ git pull https://github.com/markap14/nifi NIFI-2395

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

    https://github.com/apache/nifi/pull/734.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 #734
    
----
commit d1029fd920142d04f14e68b87ec55dc91662f600
Author: Mark Payne <ma...@hotmail.com>
Date:   2016-07-28T14:19:45Z

    NIFI-2395: Ensure that if we fail to index provenance events we do not prevent the repo from continuing to merge journals

----


---
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 #734: NIFI-2395: Ensure that if we fail to index provenanc...

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

    https://github.com/apache/nifi/pull/734#discussion_r72788219
  
    --- Diff: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java ---
    @@ -1668,24 +1669,32 @@ public Thread newThread(final Runnable r) {
                             }
                         });
     
    +                    final AtomicInteger indexingFailureCount = new AtomicInteger(0);
                         try {
                             for (int i = 0; i < configuration.getIndexThreadPoolSize(); i++) {
                                 final Callable<Object> callable = new Callable<Object>() {
                                     @Override
                                     public Object call() throws IOException {
                                         while (!eventQueue.isEmpty() || !finishedAdding.get()) {
    -                                        final Tuple<StandardProvenanceEventRecord, Integer> tuple;
                                             try {
    -                                            tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    -                                        } catch (final InterruptedException ie) {
    -                                            continue;
    +                                            final Tuple<StandardProvenanceEventRecord, Integer> tuple;
    +                                            try {
    +                                                tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    +                                            } catch (final InterruptedException ie) {
    +                                                continue;
    --- End diff --
    
    D'oh! You caught another one! Updated.


---
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 #734: NIFI-2395: Ensure that if we fail to index provenanc...

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

    https://github.com/apache/nifi/pull/734#discussion_r72735096
  
    --- Diff: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java ---
    @@ -1668,24 +1669,32 @@ public Thread newThread(final Runnable r) {
                             }
                         });
     
    +                    final AtomicInteger indexingFailureCount = new AtomicInteger(0);
                         try {
                             for (int i = 0; i < configuration.getIndexThreadPoolSize(); i++) {
                                 final Callable<Object> callable = new Callable<Object>() {
                                     @Override
                                     public Object call() throws IOException {
                                         while (!eventQueue.isEmpty() || !finishedAdding.get()) {
    -                                        final Tuple<StandardProvenanceEventRecord, Integer> tuple;
                                             try {
    -                                            tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    -                                        } catch (final InterruptedException ie) {
    -                                            continue;
    +                                            final Tuple<StandardProvenanceEventRecord, Integer> tuple;
    +                                            try {
    +                                                tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    +                                            } catch (final InterruptedException ie) {
    +                                                continue;
    --- End diff --
    
    @markap14  we want a "Thread.currentThread().interrupt();" here as well yes?


---
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 #734: NIFI-2395: Ensure that if we fail to index provenanc...

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

    https://github.com/apache/nifi/pull/734#discussion_r72636644
  
    --- Diff: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java ---
    @@ -1668,24 +1669,32 @@ public Thread newThread(final Runnable r) {
                             }
                         });
     
    +                    final AtomicInteger indexingFailureCount = new AtomicInteger(0);
                         try {
                             for (int i = 0; i < configuration.getIndexThreadPoolSize(); i++) {
                                 final Callable<Object> callable = new Callable<Object>() {
                                     @Override
                                     public Object call() throws IOException {
                                         while (!eventQueue.isEmpty() || !finishedAdding.get()) {
    -                                        final Tuple<StandardProvenanceEventRecord, Integer> tuple;
                                             try {
    -                                            tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    -                                        } catch (final InterruptedException ie) {
    --- End diff --
    
    yeah you're right - we need to ensure that we re-set the interrupt flag. Pushed an update to the PR.


---
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 #734: NIFI-2395: Ensure that if we fail to index provenanc...

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

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


---
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 #734: NIFI-2395: Ensure that if we fail to index provenanc...

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

    https://github.com/apache/nifi/pull/734#discussion_r72632413
  
    --- Diff: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java ---
    @@ -1668,24 +1669,32 @@ public Thread newThread(final Runnable r) {
                             }
                         });
     
    +                    final AtomicInteger indexingFailureCount = new AtomicInteger(0);
                         try {
                             for (int i = 0; i < configuration.getIndexThreadPoolSize(); i++) {
                                 final Callable<Object> callable = new Callable<Object>() {
                                     @Override
                                     public Object call() throws IOException {
                                         while (!eventQueue.isEmpty() || !finishedAdding.get()) {
    -                                        final Tuple<StandardProvenanceEventRecord, Integer> tuple;
                                             try {
    -                                            tuple = eventQueue.poll(10, TimeUnit.MILLISECONDS);
    -                                        } catch (final InterruptedException ie) {
    --- End diff --
    
    shouldn't we still catch interrupted and clear the intererupt?


---
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.
---