elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

[Reporting] Delete Report: remove the scheduled task from Task Manager when report is deleted. #191551

Open tsullivan opened 2 weeks ago

tsullivan commented 2 weeks ago

This issue is to address cleanup needed that causes low report task success metrics due to automated testing. Similar to https://github.com/elastic/kibana/issues/191551

Before any type of report job runs, Task Manager fires a task to the Reporting plugin, which reacts by attempting to load the report job document from the Reporting plugin's data stream. If this fails, nothing further can proceed, and in this case we can't write a specific error code anywhere because the report job document doesn't exist. We can reduce the possibility of this occurring by updating the Delete Report API to unschedule the task from task manager when a report document is deleted.

Doing this will prevent errors of this nature:

Error in finding the report from the scheduled task info!
    [id: df438627-34ce-4dc8-b418-563e86252c90] [index: .ds-.kibana-reporting-2024.08.19-000001]
elasticmachine commented 2 weeks ago

Pinging @elastic/appex-sharedux (Team:SharedUX)