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

Schedule problem when scheduler-daemon not running prior to schedule time #171

Open
acp-jsz opened this issue Jan 4, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@acp-jsz
Copy link

acp-jsz commented Jan 4, 2023

Describe the bug

The scheduler is not triggering reports not generated yet.
e.g. we do have configured to create some reports on first of month.
In case the scheduler-service is not active prior to the requested time, the reports will not get generated and send after starting the service.

Even updating the start-time of one schedule is not helping, as long as it keeps staying in the "past".
The Scheduler immediately schedules the report to the next month, without generating the missing reports.

*Workaround to regenerate the reports: *
Set the starttime of a schedule to the actual day of month one month ago, with a time of at least two minutes in the future.
e.g.
requested schedule: 01.01.2023 08:00
actual time: 03.01.2023 16:00
set starttime to: 03.12.2022 16:02

When the report is generated and send, update the starttime to the original requested schedule, so future reports get generated as needed.

To Reproduce

Steps to reproduce the behavior:

  1. Set one schedule with e.g. a monthly interval
  2. Stop the service "icinga-reporting" before reaching the time of report generation.
    (in our case the service had an exception on execution of one report, and died)
  3. Start the service "icinga-reporting" after the requested time of schedule (one second seem to be late enough)
  4. The Scheduler reports that the desired report (requested e.g. just one second ago) is scheduled to the next month.

Expected behavior

When restarting the scheduler daemon it should recognize that some reports were not executed on schedule and try to run those schedules.

Better it seems to me, that there is an additional field per schedule, indicating the last run or the next planned run.
When using the "next planned run" the schedule could be configured to the desired regular execution time
and additional one could trigger an immediate run.
Optional only the starttime of each schedule could be updated to the next execution time - so the scheduler and the user could see the next time of run.

Your Environment

  • Module version: v0.10.0
  • Dependent module versions:
  • Icinga Web 2 version and modules (System - About): v2.11.2
  • PHP version used (php --version): PHP 7.3.31-1~deb10u2
  • Server operating system and version: Debian 10 (Buster)
@yhabteab
Copy link
Member

Hii @acp-jsz, thanks for the report. Unfortunately, there is nothing the scheduler can do in this case. If the scheduler is not started on time, before the planned schedule expires, all it can do is to wait until the next one. And catching up with not running schedules is not an option, because you can never know if the scheduler was stopped on purpose or not.

@yhabteab
Copy link
Member

Though we could introduce a config option, which has to be set explicitly, to force the scheduler to catch up with schedules that are not being executed.

@yhabteab yhabteab added the enhancement New feature or request label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants