-
Notifications
You must be signed in to change notification settings - Fork 5k
[Bug] [dolphinscheduler-task-sql] NullPointerException happened when send alert. #6809
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
NullPointerException happened when run sql task.
-[2.0.0-release-prepare]
What you expected to happen
Run sql task with alert successful.
How to reproduce
[ERROR] 2021-11-11 14:31:19.462 org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread:[210] - task scheduler failure
java.lang.NullPointerException: null
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.sendAlert(TaskExecuteThread.java:225)
at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:196)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.apache.dolphinscheduler.plugin.task.sql.SqlTask.sendAttachment(SqlTask:280);
private void sendAttachment(int groupId, String title, String content) {
setNeedAlert(Boolean.TRUE);
TaskAlertInfo taskAlertInfo = new TaskAlertInfo();
taskAlertInfo.setAlertGroupId(groupId);
taskAlertInfo.setContent(content);
taskAlertInfo.setTitle(title);
}
Forget to setTaskAlertInfo?
private void sendAttachment(int groupId, String title, String content) {
setNeedAlert(Boolean.TRUE);
TaskAlertInfo taskAlertInfo = new TaskAlertInfo();
taskAlertInfo.setAlertGroupId(groupId);
taskAlertInfo.setContent(content);
taskAlertInfo.setTitle(title);
setTaskAlertInfo(taskAlertInfo);
}
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct