You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/03/14 02:58:55 UTC
[GitHub] [flink] chummyhe89 commented on issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamSourceOperato…
chummyhe89 commented on issue #5394: [FLINK-6571][tests] Catch InterruptedException in StreamSourceOperato…
URL: https://github.com/apache/flink/pull/5394#issuecomment-472685821
Does this resolve the problem?
```java
@Override
public void run(SourceContext<T> ctx) throws Exception {
boolean interrupted = false;
try {
while (running) {
try {
Thread.sleep(20);
}catch (InterruptedException ignored){
interrupted = true;
}
}
}finally {
if(interrupted){
Thread.currentThread().interrupt();
}
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services