-
Notifications
You must be signed in to change notification settings - Fork 79
Jobs executed twice after 24 hours #192 8000 span>
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
Comments
Um... That is quite strange. I think I need to ask you for steps to reproduce this. If you can publish a Docker image that reproduces this, that would be ideal. |
Sorry, I didn't get a notification from Github. I use this image: blacklabelops/jobber-cron. I also created a fork and modified it to support Jobber 1.3.2 with the same result. I will try your docker image and give you feedback. |
I have a similar behavior with your image. The jobs are executed twice right away:
|
Here's the scheduling code:
I suspect that, for some reason, the |
It's executed 2-3 seconds before and again at the scheduled time. I will try your container on another Docker host. Maybe it's related to the kernel and/or Docker version used on my primary Docker host... Any hints on how can I debug this? Do I have to add logging of the variables to the code and compile it again or can I debug the compiled code? |
I may have a fix. I’m going to compile it and send it to you to try out. Please give me a few days.
Dylan
… On May 15, 2018, at 12:07 PM, Christian Kotte ***@***.***> wrote:
It's executed 2-3 seconds before and again at the scheduled time. I will try your container on another Docker host. Maybe it's related to the kernel and/or Docker version used on my primary Docker host...
Any hints on how can I debug this? Do I have to add logging of the variables to the code and compile it again or can I debug the compiled code?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I am facing the same issue with 1.2 version. In my case, it is happening alternate day. For example, refer below log: 2018-05-18 10:00:00.859403633 -0400 EDT DailyEmails root true Good If we look at the logs, job executed twice on 16th and 18th whereas once on 17th. |
I've made a Docker image containing what I hope is a fix. Could one of you please try it out? It's dshearer/jobber:1.3.3-pr.1-alpine3.7 |
I tried it. Unfortunately, I have the same behavior:
|
I really can't imagine what is causing this. Unfortunately, I cannot reproduce it. If you can provide instructions for reproducing it, that would help. Otherwise, I need to think about this. |
Sorry, I'm a bit busy at the moment. I don't know how to reproduce. Maybe it's related to the kernel or Docker version I use..!? I need to do more tests to narrow down the issue.. Could you create a special version that logs the values of the variables etc. to a logfile during execution or something similar?
This is a part of the Dockerfile I used with your Docker image:
This is the test jobber file:
Current status on jobber test container:
|
Hello, |
Thanks for the info. I'll keep working on this. |
Ok. @ckotte , I've done as you asked: I've made a build that logs some useful info when scheduling jobs. dshearer/jobber:1.3.3-pr.2-alpine-3.7 Here's an example of the output:
It goes to stdout. You can also write this to disk with the
|
thx. I updated my jobber test container with your new version. I will let you know. |
Ok. Here is the output:
|
I am flabbergasted. |
Sorry, I've been quite busy with some personal stuff. Would one of you be able to do some experiments?
Does the problem remain after either of these changes? |
I will try this after I'm back from vacation in 2 weeks. |
Same issue with different frequency. Looks like the issue always starts the next day...
|
I have finally reproduced this! I'll have a fix this weekend. |
Actually, this is taking longer than expected to make the fix. I'll keep this issue updated. |
ok. thx. How could you reproduce this? Is it a general issue in the code or related to a specific setting? |
This seems to be limited to jobber running in Docker. I reproduced it by running jobber in Docker with a small job that runs every hour.
… On Aug 6, 2018, at 12:20 AM, Christian Kotte ***@***.***> wrote:
ok. thx. How could you reproduce this? Is it a general issue in the code or related to a specific setting?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ugh. I haven't been able to reproduce it again. Sorry this is taking so long to fix. I can only work on this on the weekends. |
I don't know guys. Jobber's code is correct. This has something to do with Docker. I really don't know what to do at this point. |
Thank you very much for your time and effort. Could you re-produce it in Docker again or only the first time? |
Only the first time. It is very frustrating. |
Okay, I reproduced it again, with a job called "Test" that runs every minute:
Here's the implementation: At startup, Jobber computes the next run time for each job, and then puts each job in a priority queue that is sorted by runtime. When
The log indicates that, at some point, now == Aug 19 19:27:59, *job.NextRunTime == Aug 19 19:28:00, and yet now.Before(*job.NextRunTime) returned false. |
I've managed to reproduce this in a small program. I'll probably open a bug with the Go team. |
- A bug in Go's time package (golang/go#27090) was causing jobs to be executed multiple times. In this commit, we provide a workaround.
(#192) Bugfix in queue.go: Job execed multiple times
Implemented workaround. |
Fix is in v1.3.4. Please let me know if it works. |
The first backup is executed at 2AM as scheduled, but all subsequent backups also start 2 seconds before 2AM!?
This will create two backup files for each job and sometimes the backup fails because it can't access files while the same backup job runs more or less in parallel.
This issue happens with Jobber 1.2 and also with Jobber 1.3.2. I use a custom Docker container based on Alpine 3.7 with Jobber built from sources.
The text was updated successfully, but these errors were encountered: