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

2016-07-29 Thread asfgit
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-07-29 Thread markap14
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 callable = new 
Callable() {
 @Override
 public Object call() throws IOException {
 while (!eventQueue.isEmpty() || 
!finishedAdding.get()) {
-final 
Tuple tuple;
 try {
-tuple = eventQueue.poll(10, 
TimeUnit.MILLISECONDS);
-} catch (final 
InterruptedException ie) {
-continue;
+final 
Tuple 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-07-28 Thread joewitt
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 callable = new 
Callable() {
 @Override
 public Object call() throws IOException {
 while (!eventQueue.isEmpty() || 
!finishedAdding.get()) {
-final 
Tuple tuple;
 try {
-tuple = eventQueue.poll(10, 
TimeUnit.MILLISECONDS);
-} catch (final 
InterruptedException ie) {
-continue;
+final 
Tuple 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-07-28 Thread markap14
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 callable = new 
Callable() {
 @Override
 public Object call() throws IOException {
 while (!eventQueue.isEmpty() || 
!finishedAdding.get()) {
-final 
Tuple 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


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

2016-07-28 Thread joewitt
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 callable = new 
Callable() {
 @Override
 public Object call() throws IOException {
 while (!eventQueue.isEmpty() || 
!finishedAdding.get()) {
-final 
Tuple 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---