[Fix-17854][Worker&SQL Task] Add sql task result alert from worker to alert by rpc#17856
[Fix-17854][Worker&SQL Task] Add sql task result alert from worker to alert by rpc#17856njnu-seafish wants to merge 11 commits intoapache:devfrom
Conversation
|
Hey @ruanwenjun @SbloodyS, whenever you have time, would you mind reviewing this fix to see if it looks reasonable? Really thanks a lot! |
ruanwenjun
left a comment
There was a problem hiding this comment.
This seems unrelated to the task executor lifecycle, it is a feature of the SQL task.
If the Worker can load the alert plugin, it can send this notification itself. Maybe it's time for us to remove the AlertServer.
Hey, Can task result alerts be considered similar to the YarnAppId generated by a task—i.e., as additional auxiliary events occurring during the task's lifecycle? Is the intention to deprecate the AlertServer role and migrate all alerting logic to the Worker? If so, note that Workers currently cannot access the database. |
Task results can be treated as part of the task execution context, but this should only store elements like the task result path. It is not suitable for storing SQL output. We should not store task outputs or similar content in the database, as this is highly non-generic, the output might very large.
For such alerts, we do not need to persist them to the database. |
To prevent excessive resource usage, the size of task result alerts must be constrained—just as we do with log output by limiting the number of displayed lines.
Alert sending should be asynchronous to avoid blocking the main flow. |
|
Here, the alert should be sent synchronously rather than asynchronously. |
Hi, I've switched to a synchronous sending approach—could you please review it? @ruanwenjun |
|
Hey @ruanwenjun @SbloodyS, whenever you have time, please review it. Really thanks a lot! The previous asynchronous sending alert logic was: Worker → Master → DB → Alert. I have tested both of these approaches in my own environment, and the logs for the synchronous approach are as follows: |
ruanwenjun
left a comment
There was a problem hiding this comment.
Currently, only SQL tasks use this; please do not extend this to all task plugins.
| protected boolean needAlert = false; | ||
|
|
||
| protected TaskAlertInfo taskAlertInfo; | ||
| protected TaskResultAlertInfo taskResultAlertInfo; |
There was a problem hiding this comment.
Please don't add this into AbstractTask, this should only used at SqlTask?
| * send alert | ||
| */ | ||
| private Boolean sendEmail; | ||
| private Boolean sendAlert; |
There was a problem hiding this comment.
Do not break compatibility casually.
| @Deprecated | ||
| void updateTaskInstanceInfo(int taskInstanceId); | ||
|
|
||
| void sendAlert(int groupId, String title, String content, AlertType alertType); |
There was a problem hiding this comment.
Don't add this at TaskCallBack, you can see Deprecated at updateTaskInstanceInfo.



Purpose of the pull request
close #17854
Brief change log
Add sql task result alert from worker to master by rpc
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md