[GitHub] flink issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamS...

2018-04-08 Thread zentol
Github user zentol commented on the issue: https://github.com/apache/flink/pull/5394 I think neither solve the problem. Variant 2 looks identical to what we have in master. Variant 1 only allows interrupts after the task was canceled. According to what

[GitHub] flink issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamS...

2018-03-29 Thread tillrohrmann
Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/5394 What's the state @zentol? Would Stephan's proposal work? ---

[GitHub] flink issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamS...

2018-03-02 Thread StephanEwen
Github user StephanEwen commented on the issue: https://github.com/apache/flink/pull/5394 I have often handled it like one of the below variants. What do you think about that pattern? ### Variant 1: Handle interruption if still running ```java public void

[GitHub] flink issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamS...

2018-02-05 Thread zentol
Github user zentol commented on the issue: https://github.com/apache/flink/pull/5394 How about calling `Thread.currentThread().interrupt();` only after having left the loop? ``` public void run(SourceContext ctx) throws Exception { boolean setInterruptFlag = false;

[GitHub] flink issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamS...

2018-02-01 Thread StephanEwen
Github user StephanEwen commented on the issue: https://github.com/apache/flink/pull/5394 It may not be a problem in this test, but I wanted to raise that this pattern is a bit dangerous. If the thread ever gets interrupted while 'running' is still true, this goes into a hot loop