The function run_finished_hook is not currently called when errors occur. This can result in the creation of states in the on_started_hook function that cannot be cleaned up after the request ends, regardless of its success. Therefore, it is necessary to add the run_finished_hook function to the error handling path.
The function
run_finished_hook
is not currently called when errors occur. This can result in the creation of states in theon_started_hook
function that cannot be cleaned up after the request ends, regardless of its success. Therefore, it is necessary to add therun_finished_hook
function to the error handling path.