Github user jinmingjian commented on a diff in the pull request:
https://github.com/apache/flink/pull/3420#discussion_r103627979
--- Diff:
flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/KillerWatchDog.java
---
@@ -42,12 +42,12 @@
@SuppressWarnings("deprecation")
@Override
public void run() {
- final long deadline = System.currentTimeMillis() + timeout;
+ final long deadline = System.nanoTime() + timeout * 1_000_000L;
long now;
- while (toKill.isAlive() && (now = System.currentTimeMillis()) <
deadline) {
+ while (toKill.isAlive() && (now = System.nanoTime()) <
deadline) {
try {
- toKill.join(deadline - now);
+ toKill.join((deadline - now) / 1_000_000L);
--- End diff --
thanks for pointing this, my mistake for ignoring the API of Thread#join:)
I proposed a simple move of rounding.
It is found that the Thread#join is using the System.currentTimeMillis().
So the fix may be not as strong as we expected. The better may be that we do
not fix KillerWatchDog because the "last resort" codes already there.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---