question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maintenance window's "NextExecutionTime" is updated as soon as execution begins, causing instances to be shut down at the next scheduler interval

See original GitHub issue

After working around #99 and #100, I am still unable to use the SSM maintenance window functionality. I’ve attempted to outline the behavior I am seeing below. Please let me know if I can elaborate on anything.

  1. The instances that are configured with a schedule that references a maintenance window are started at least 10 minutes before the maintenance window based on the schedule/period created from the maintenance window’s NextExecutionTime. The running period is 2 hours in duration, as expected. This matches the maintenance window duration.

  2. The SSM maintenance window tasks begin. By this time the instances are running and recognized by SSM. I am executing Run Command tasks to run the AWS-UpdateSSMAgent and AWS-RunPatchBaseline documents.

  3. At the next scheduler interval (10 minutes later, for example), the instances are stopped because the scheduler has created a new schedule/period based on the maintenance window’s updated NextExecutionTime. It appears that the previously created period/schedule is overwritten and the scheduler believes that the desired state is “stopped”. In my case, the NextExecutionTime is one week in the future, as the maintenance window is scheduled once per week. This causes the pending Run Command tasks to fail and tasks that have yet to start to report NoInstancesInTag.

The expected behavior is that the scheduler would keep the instances running for the duration of the maintenance window.

Is this a bug in the scheduler’s maintenance window functionality or am I failing to understand something about how this solution is intended to be used?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chaitand28commented, Mar 10, 2020

This issue has been fixed in the release 1.3.1. Please deploy the latest template to get the updated code.

1reaction
hoppalottacommented, Jan 2, 2020

I can confirm I am seeing the exact same behavior as @georgematthew. Using 1.3 and a schedule that is effectively always off other than the ssm maintenance period.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maintenance window's "NextExecutionTime" is updated as ...
Maintenance window's "NextExecutionTime" is updated as soon as execution begins, causing instances to be shut down at the next scheduler interval #101.
Read more >
Maintenance window scheduling and active period options
The maintenance window is allowed to run up to five hours, as needed, but new tasks are prevented from starting two hours before...
Read more >
Scheduled jobs - Optimizely
This topic describes scheduled jobs in Optimizely CMS that run in the background at preset time intervals and typically perform cleanup and updating...
Read more >
System Error Messages for Cisco Unified Communications ...
2, Unexpected shutdown; possibly cause is application disconnected the TCP ... Explanation Scheduler failed to update next execution time.
Read more >
Creating an Execution Package - Support Topics
Overview Execution packages will automatically update the staging database, ... Starting the Jet Data Manager Scheduler Service ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found