apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code
https://dolphinscheduler.apache.org/
Apache License 2.0
12.89k stars 4.63k forks source link

[Bug] [Alert] AlertSendStatus doesn't make any sense. #16820

Closed toujours33 closed 2 days ago

toujours33 commented 3 days ago

Search before asking

What happened

After alert sent, the AlertStatus keep PartialSuccess whenever the alert behavior was.

long failureCount = alertSendStatuses.stream() .map(alertSendStatus -> alertSendStatus.getSendStatus() == AlertStatus.EXECUTION_FAILURE) .count(); long successCount = alertSendStatuses.stream() .map(alertSendStatus -> alertSendStatus.getSendStatus() == AlertStatus.EXECUTION_SUCCESS) .count();

failureCount or successCount are consistent for map function change AlertSendStatus stream to Boolean stream.

What you expected to happen

The failureCount and successCount must count correctly

How to reproduce

  1. Configure a alert instance and alert group
  2. Create a process
  3. Trigger the process by set Notification Strategy with All and Alarm Group in 1st step
  4. Fetch records in table t_ds_alert, you can see alert_status column all in value 3, which means PartialSuccess.

Anything else

No response

Version

dev

Are you willing to submit PR?

Code of Conduct

ruanwenjun commented 3 days ago

We should use filter here

toujours33 commented 2 days ago

We should use filter here

Yes, I will fix this issue, and will also consider adding some unit tests to cover this issue

ruanwenjun commented 2 days ago

We should use filter here

Yes, I will fix this issue, and will also consider adding some unit tests to cover this issue

Thanks, assigned to you, it's better to add integration test case for AlertServer, I create a new issue to track https://github.com/apache/dolphinscheduler/issues/16823