Github user steveblackmon commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/100#discussion_r18968188
--- Diff:
streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsPersistWriterTask.java
---
@@ -90,28 +99,30 @@ public boolean isRunning() {
public void run() {
try {
this.writer.prepare(this.streamConfig);
- StreamsDatum datum = this.inQueue.poll();
while(this.keepRunning.get()) {
+ StreamsDatum datum = null;
+ try {
+ this.blocked.set(true);
+ datum = this.inQueue.poll(5, TimeUnit.SECONDS);
+ this.blocked.set(false);
+ } catch (InterruptedException ie) {
+ LOGGER.error("Received InterruptedException. Shutting
down and re-applying interrupt status.");
+ this.keepRunning.set(false);
+ Thread.currentThread().interrupt();
+ }
if(datum != null) {
try {
this.writer.write(datum);
statusCounter.incrementStatus(DatumStatus.SUCCESS);
} catch (Exception e) {
LOGGER.error("Error writing to persist writer {}",
this.writer.getClass().getSimpleName(), e);
- this.keepRunning.set(false);
+ this.keepRunning.set(false); // why do we shutdown
on a failed write ?
--- End diff --
no it is not. LOGGER.warn is an appropriate action on a failed write. or
retry
---
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 [email protected] or file a JIRA ticket
with INFRA.
---