Skip to content

Commit

Permalink
fix(backend): stop heartbeat status updates for ScheduledWorkflows. F…
Browse files Browse the repository at this point in the history
…ixes #8757 (#11363)

* fix(backend): stop heartbeat status updates in ScheduledWorkflow controller. Fixes #8757

Signed-off-by: demarna1 <[email protected]>

* Update scheduled_workflow_test.go

Signed-off-by: demarna1 <[email protected]>

---------

Signed-off-by: demarna1 <[email protected]>
  • Loading branch information
demarna1 authored Nov 26, 2024
1 parent 94a21cc commit 9ccec4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ func (s *ScheduledWorkflow) UpdateStatus(updatedEpoch int64, submitted bool,
scheduledEpoch int64, active []swfapi.WorkflowStatus,
completed []swfapi.WorkflowStatus, location *time.Location) {

updatedTime := metav1.NewTime(time.Unix(updatedEpoch, 0).UTC())
// updatedEpoch contains current time but using current time causes the
// SWF to fail to be reconciled by the controller. Set LastProbeTime and
// LastTransitionTime to 0 to avoid the irreconcilable status updates.
updatedTime := metav1.NewTime(time.Unix(0, 0).UTC())

conditionType, status, message := s.getStatusAndMessage(len(active))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func TestScheduledWorkflow_GetNextScheduledEpoch_PeriodicSchedule(t *testing.T)
func TestScheduledWorkflow_GetNextScheduledEpoch_UpdateStatus_NoWorkflow(t *testing.T) {
// Must run now
scheduledEpoch := int64(10 * hour)
updatedEpoch := int64(11 * hour)
updatedEpoch := int64(0)
creationTimestamp := metav1.NewTime(time.Unix(9*hour, 0).UTC())

schedule := NewScheduledWorkflow(&swfapi.ScheduledWorkflow{
Expand Down Expand Up @@ -591,7 +591,7 @@ func createStatus(workflowName string, scheduledEpoch int64) *swfapi.WorkflowSta
func TestScheduledWorkflow_GetNextScheduledEpoch_UpdateStatus_WithWorkflow(t *testing.T) {
// Must run now
scheduledEpoch := int64(10 * hour)
updatedEpoch := int64(11 * hour)
updatedEpoch := int64(0)
creationTimestamp := metav1.NewTime(time.Unix(9*hour, 0).UTC())

schedule := NewScheduledWorkflow(&swfapi.ScheduledWorkflow{
Expand Down

0 comments on commit 9ccec4c

Please sign in to comment.