streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfranklin <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 191
Date Thu, 16 Oct 2014 12:51:06 GMT
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/100#discussion_r18952760
  
    --- 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 --
    
    I don't think shutting down an single datum fail is correct. 


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

Mime
View raw message