Ir para o conteúdo

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

feita há 5 meses86 visualizações
1 Resposta
0
Resposta aceita

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

respondido há 5 meses
AWS
ENGENHEIRO DE SUPORTE
avaliado há 5 meses
AWS
ESPECIALISTA
avaliado há 5 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.