Github user rmetzger commented on a diff in the pull request: https://github.com/apache/flink/pull/2434#discussion_r76612209 --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/DefaultTimeServiceProvider.java --- @@ -57,4 +67,49 @@ public void shutdownService() throws Exception { } timerService.shutdownNow(); } + + /** + * Internal task that is invoked by the timer service and triggers the target. + */ + private static final class TriggerTask implements Runnable { + + private final Object lock; + private final Triggerable target; + private final long timestamp; + private final StreamTask<?, ?> task; + + TriggerTask(StreamTask<?, ?> task, final Object lock, Triggerable target, long timestamp) { + this.task = task; + this.lock = lock; + this.target = target; + this.timestamp = timestamp; + } + + @Override + public void run() { + synchronized (lock) { + try { + target.trigger(timestamp); + } catch (Throwable t) { + + if (task != null) { + // registers the exception with the calling task + // so that it can be logged and (later) detected + TimerException asyncException = new TimerException(t); + task.registerAsyncException("Caught exception while processing timer.", asyncException); + } else { + // this is for when we are in testing mode and we + // want to have real processing time. + System.err.println("!!! Caught exception while processing timer. !!!"); --- End diff -- Why are you not using the regular logging for this?
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---