influxdata / influxdata/influxdb

Cron tasks executed twice and at wrong local time

Open
#23,992 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
1. Create a cron task
2. Set the mask time at: 0 0 * * * with 0 offset
3. Task is executed twice: once at midnight UTC and once at midnight UTC + (or -) local time offset. So if the local time is UTC+3 the second execution will happen at 03:00AM local time

__Expected behavior:__
One execution at the correct time.

__Actual behavior:__
Tasks are executed twice, once at `utc_time` and the second at `utc_time` + `tz_offset`

__Environment info:__

* System info: happens on all environments for me
* InfluxDB version: 2.5.1

This issue, in similar forms, has been reported several times at #20922, #20353, #23257 one user went to extreme lengths to try and address it by himself in this [Daily task in different timezone ](https://community.influxdata.com/t/daily-task-in-different-timezone/24085) thread in the community forum. All these issues seems to stem from the same place, but no answer has ever been given, though the issue seem to persist since at least 2020.

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is named. Start by reproducing the cron task behavior from the listed steps, then trace the scheduling and timezone handling that produces both executions. Done means a task with a zero offset executes once at the intended local time, with regression coverage for the reported UTC+3 case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.