Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron-based task doesn't run at system time #20922

Open
JFCmedlinetec opened this issue Mar 11, 2021 · 1 comment
Open

Cron-based task doesn't run at system time #20922

JFCmedlinetec opened this issue Mar 11, 2021 · 1 comment
Labels
area/tasks area/2.x OSS 2.0 related issues and PRs

Comments

@JFCmedlinetec
Copy link

When I schedule a cron-based task in InfluxDB it does not run at system time the first time that it has to be executed (as per documentation says the cron option is based on system time).
The first time it runs in UTC time.
From the second time onwards it runs with the same hour as the system time how it's supposed to always happen.

We use Docker in my company so InfluxDB live within a container with Debian (with Alpine Linux also fails).

Minimal actions needed to reproduce the behavior:

  1. docker pull influxdb
  2. docker run -p 8086:8086 --name influxdb --privileged influxdb
  3. Inside container: ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime
  4. Initial Setup influxDB GUI with username, password, org and initial bucket
  5. Create the following task:
    option task = {name: "Task1", cron: "0 14 * * *"}
    option v1 = {timeRangeStart: -7h, timeRangeStop: now()}
    data = from(bucket: "initialBucket")
    |> range(start: v1.timeRangeStart, stop: v1.timeRangeStop)
    |> filter(fn: (r) => (r._measurement == "something"))
    (No matter that the task doesn't make sense, it's just for the purpose of checking its execution)

My hardware clock and the system time looks like this in the container:
/etc # hwclock
2021-03-10 18:06:31.945795+01:00
/etc # date
Wed Mar 10 18:06:34 CET 2021

I think the time zone is as it should be.
My time zone is "Europe/Madrid", +01:00 right now (+02:00 in summer with DST).

The task should run at 14:00 local time (system time), however the first time it will run at 14:00 UTC (15:00 local time).
From the second run the execution time is correct (14:00 local time).

I've researched and read everywhere and I'm not able to find a reason or if it's happening to someone else.

Environment info:

  • System info: Linux 4.19.104-microsoft-standard x86_64
  • InfluxDB version: InfluxDB 2.0.4 (git: 4e7a59b) build_date: 2021-02-08T17:47:02Z
  • Docker Version: 3.2.1 (61626), Engine 20.10.5.
@danxmoran danxmoran added area/2.x OSS 2.0 related issues and PRs area/tasks labels Mar 11, 2021
@danxmoran danxmoran self-assigned this Mar 11, 2021
@vkhemani
Copy link

Hi, i am facing the same problem. Any solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tasks area/2.x OSS 2.0 related issues and PRs
Projects
None yet
Development

No branches or pull requests

4 participants