[ 
https://issues.apache.org/jira/browse/METRON-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16350404#comment-16350404
 ] 

ASF GitHub Bot commented on METRON-1438:
----------------------------------------

Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/920#discussion_r165659854
  
    --- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/shell/cli/PausableInput.java
 ---
    @@ -36,8 +37,8 @@
      *
      */
     public class PausableInput extends InputStream {
    -  InputStream in = System.in;
    -  boolean paused = false;
    +  private InputStream in = System.in;
    +  private AtomicBoolean paused = new AtomicBoolean(false);
    --- End diff --
    
    I found in travis and locally, that the PausableInput was hanging, my 
builds where not completing.      PausableInput.INSTANCE.unpause(); was never 
returning.
    
    I couldn't figure out why it was locked.  Reading the class documentation 
and the trying to understand the threading in the shell, I looked at the class 
and saw some inconsistencies with how and when we checked if we where paused in 
the different read() calls, and also that the flag field was not volatile or 
atomic.  I refactored this things to what I *think* would be the correct and 
consistent approaches and .... it resolved my issue.


> STELLAR: Move shell functions to common from metron-management
> --------------------------------------------------------------
>
>                 Key: METRON-1438
>                 URL: https://issues.apache.org/jira/browse/METRON-1438
>             Project: Metron
>          Issue Type: Sub-task
>            Reporter: Otto Fowler
>            Assignee: Otto Fowler
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to