Skip to content

Conversation

@justinkaseman
Copy link
Contributor

@justinkaseman justinkaseman commented Aug 27, 2025

Description

In the situation where a workflow fails to be created by the Workflow Registry Syncer, it is put into a pending state that will exponentially back off.

While something is in the pending state, if it then gets deleted from the Workflow Registry, it will no longer show up during the Workflow Metadata query - which leaves an orphaned pending event.

There is no mechanism to clean these up. Instead the current behavior is to error out as an invariant. This scenario is not an invariant.

Note

This change and the change to handle delete events first will be back ported to V1 WF Registry Syncer after this PR is merged.

@github-actions
Copy link
Contributor

I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.


if len(pendingEvents) != 0 {
return nil, fmt.Errorf("invariant violation: some pending events were not handled in the reconcile loop: keys=%+v, len=%d", maps.Keys(pendingEvents), len(pendingEvents))
w.lggr.Debugf("some pending events were not handled in the reconcile loop, cleaning up: keys=%+v, len=%d", maps.Keys(pendingEvents), len(pendingEvents))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinkaseman Hmmm... the intention was for the code above to handle all cases, including cleaning up any pending events that are no longer relevant. (See for instance this clause which illustrates what I mean: https://github.com/smartcontractkit/chainlink/pull/19117/files#diff-66829056a38220ab64391f36184d372d6ec0e3c03ef7ae393f103ecd378b1d92L268)

Do you have an example of a scenario that wasn't handled by the code above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the one laid out in the PR description and test.

That's good context. I do like that intention. Let me think on if there is a way to handle it instead of removing the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I changed it to specifically only handle the "pending create event is left over" case, by checking if the create event is no longer in wf metadata. If it's not there, then it's safe to throw it away, because it's no longer a workflow that needs to be created.

@justinkaseman justinkaseman requested a review from a team August 27, 2025 16:32
@cl-sonarqube-production
Copy link

@justinkaseman justinkaseman requested a review from a team August 27, 2025 16:50
@justinkaseman justinkaseman changed the title (fix): Workflow Registry Syncer no longer errors on leftover pending events (fix): Workflow Registry Syncer no longer errors on orphaned pending create events Aug 27, 2025
@justinkaseman justinkaseman added this pull request to the merge queue Aug 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 27, 2025
@justinkaseman justinkaseman added this pull request to the merge queue Aug 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 27, 2025
@justinkaseman justinkaseman added this pull request to the merge queue Aug 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 27, 2025
@justinkaseman justinkaseman added this pull request to the merge queue Aug 27, 2025
Merged via the queue into develop with commit 2674c36 Aug 27, 2025
150 of 151 checks passed
@justinkaseman justinkaseman deleted the CAPPL-914 branch August 27, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants