내용으로 건너뛰기

Bug?: AWS EventBridge Rate based scheduler Ignores End Date

0

Greetings, i was doing some Rate-Based minute test. With the following setup:

Schedule start I am expecting that the last time this triggers the Lambda function is at 10:20 Local time. When the time is passed, the start and end date are removed. Past scheduled Time However, in live Trail we can still see that the job is fired Live Trail lambda executed after end date

When the lambda is invoked I update the target with the current fire time but I am not updating the start or end date. From an update perspective I do not see the end date being changed as expected. but maybe the update causes the rate scheduler to still fire/ Boto 3 lambda update scheduler

I Also know that the enddate is optional for rate based schedules. So it runs forever. So another thing I can see happened here. is that the after end date is reached and then gets removed, instead of disable the schedule it now runs forever with no end date.

End date is ignored but one time schedules, but should not be the case for cron/rate.

Kind regards,

Stephan

질문됨 5달 전79회 조회
1개 답변
0
수락된 답변

The behavior you're experiencing with EventBridge Scheduler is not a bug, but rather a result of how the update operation works with schedules.

When you update a schedule using the UpdateSchedule operation (which your Lambda is doing via boto3), if you don't explicitly include the EndDate parameter in your update request, it will default to null. This effectively removes the end date constraint from your schedule, causing it to run indefinitely.

In your Lambda code, you're updating the schedule with the current fire time, but you're not preserving the original EndDate value. This is why your schedule continues to run even after what should have been its end date - the update operation is removing that constraint.

To fix this issue, you need to ensure that when you update the schedule, you include the original EndDate parameter if you want to maintain that constraint. Otherwise, the schedule will continue running indefinitely as a rate-based schedule with no end date.

If you want to stop a schedule from running after a certain point, you have two options:

  1. Always include the EndDate in your update operations
  2. Change the state of the schedule to DISABLED when you detect it should no longer run (using the --state DISABLED parameter)

Rate-based schedules should respect the EndDate parameter when it's properly set and maintained through updates.
Sources
UpdateSchedule - EventBridge Scheduler
Schedule types in EventBridge Scheduler - EventBridge Scheduler
Changing the schedule state in EventBridge Scheduler - EventBridge Scheduler

답변함 5달 전
AWS
지원 엔지니어
검토됨 5달 전
AWS
전문가
검토됨 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠