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