Skip to content

Commit

Permalink
quarkusio#4241 100% CPU in epoll_wait
Browse files Browse the repository at this point in the history
  • Loading branch information
rvansa committed Sep 27, 2019
1 parent 9b52fcf commit c51a26d
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,37 @@ private static Queue<Runnable> newTaskQueue0(int maxPendingTasks) {
}
}

final class Holder_io_netty_util_concurrent_ScheduledFutureTask {
private static long START_TIME = Long.MIN_VALUE;

static long startTime() {
if (START_TIME == Long.MIN_VALUE) {
START_TIME = System.nanoTime();
}
return START_TIME;
}
}

@TargetClass(className = "io.netty.util.concurrent.ScheduledFutureTask")
final class Target_io_netty_util_concurrent_ScheduledFutureTask {

@Substitute
static long nanoTime() {
return System.nanoTime() - Holder_io_netty_util_concurrent_ScheduledFutureTask.startTime();
}

@Alias
public long deadlineNanos() {
return 0;
}

@Substitute
public long delayNanos(long currentTimeNanos) {
return Math.max(0,
deadlineNanos() - (currentTimeNanos - Holder_io_netty_util_concurrent_ScheduledFutureTask.startTime()));
}
}

class NettySubstitutions {

}

0 comments on commit c51a26d

Please sign in to comment.