Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix multi failure notify #524

Merged
merged 1 commit into from
May 23, 2024
Merged

Conversation

suchen-sci
Copy link
Contributor

@suchen-sci suchen-sci commented May 22, 2024

Fix #523

In channel.go within the Channel.WatchEvent function, the code checks result and uses its information to decide whether to send a notification. However, in notification_strategy.go, the NotificationStrategyData.ProcessStatus function updates the status and the number of notifications sent.

This means that in the case of #523, since the failure count is set to 2 and a failure occurs in the init state, the channel does not send a notification because it is in the init state. However, NotificationStrategyData considers the notification already sent and IsExceedMaxTimes returns true.

As a result, no notification is sent. To fix this problem, when in the init state, NotificationStrategyData should not be updated. According to the logic and comments in channel.go, init is a special state. This fix should be fine.

Copy link
Collaborator

@samanhappy samanhappy left a comment

Choose a reason for hiding this comment

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

LGTM

@suchen-sci suchen-sci merged commit 3988429 into megaease:main May 23, 2024
6 checks passed
@suchen-sci suchen-sci deleted the fix-multi-fail-notify branch May 23, 2024 07:20
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.

Notify with failure parameter more than 1.
2 participants