apache / apache/druid

FileRequestLogger is prone to clock drift

Open
#9,284 2 comments 0 reactions 0 assignees View on GitHub
Area - Operations Bug Contributions Welcome
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

[`FileRequestLogger`](https://github.com/apache/druid/blob/master/server/src/main/java/org/apache/druid/server/log/FileRequestLogger.java) must not be provided with `ScheduledThreadPoolExecutor` to rotate request file logs and increment `currentDay`:
https://github.com/apache/druid/blob/6ee0afa8e5cdfd36409ef78b236bba085c40c892/server/src/main/java/org/apache/druid/server/log/FileRequestLogger.java#L84-L108

Because `ScheduledThreadPoolExecutor` is prone to [unbounded clock drift](https://medium.com/@leventov/cronscheduler-a-reliable-java-scheduler-for-external-interactions-cb7ce4a4f2cd).

[CronScheduler](https://github.com/TimeAndSpaceIO/CronScheduler) could be used instead.

Contributor guide

Open the contributing guide

Research direction

Start with server/src/main/java/org/apache/druid/server/log/FileRequestLogger.java around lines 84-108 and review how ScheduledThreadPoolExecutor rotates request logs and increments currentDay. Evaluate the proposed CronScheduler replacement, with done meaning log rotation and currentDay updates no longer suffer from unbounded clock drift.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.