Skip to content

Conversation

@dirrao
Copy link
Contributor

@dirrao dirrao commented Sep 23, 2024

Right now, when the tasks fail due to pod launch failures or the pod is stuck in the pending phase, then the task logs from the UI are empty. It is very inconvenient for airflow consumers to debug it. They might not have access to the scheduler logs. We can push these failure reasons from the Kubernetes executor to task logs. So, that airflow consumers can able to see task failure reasons from the UI.

closes: #37435

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Sep 23, 2024
@dirrao dirrao self-assigned this Sep 23, 2024
@dirrao dirrao requested review from Taragolis and eladkal September 24, 2024 07:47
@dirrao dirrao requested a review from potiuk October 4, 2024 05:51
@dirrao
Copy link
Contributor Author

dirrao commented Oct 4, 2024

@jedcunningham / @hussein-awala
Can you review this MR when you are free?

@eladkal eladkal requested a review from romsharon98 October 6, 2024 16:44
@dirrao dirrao force-pushed the k8s_executor_task_logging branch from 407476a to 140166f Compare October 10, 2024 10:19
@dirrao
Copy link
Contributor Author

dirrao commented Oct 10, 2024

@romsharon98
Can you review it when you are free?

@dirrao
Copy link
Contributor Author

dirrao commented Oct 15, 2024

@jedcunningham / @hussein-awala
Can you review this MR when you are free?

@dirrao
Copy link
Contributor Author

dirrao commented Oct 19, 2024

@dstandish
With the changes introduced in PR #43183, is it still feasible to generate logs from locations other than the workers? If so, could you please provide a few references to explain this?

@dstandish
Copy link
Contributor

@dstandish With the changes introduced in PR #43183, is it still feasible to generate logs from locations other than the workers? If so, could you please provide a few references to explain this?

Yes, you add a log record. Was done recently in an aws executor

@dstandish
Copy link
Contributor

@dstandish With the changes introduced in PR #43183, is it still feasible to generate logs from locations other than the workers? If so, could you please provide a few references to explain this?

Ok following up with more specifics this morning.

Look at BaseExecutor.log_task_event

executors do not have access to a session, so from executor when we need to send this kind of message, we write the log records to a queue, and the scheduler consumes this queue and writes to db.

cc @potiuk

@potiuk
Copy link
Member

potiuk commented Oct 20, 2024

Look at BaseExecutor.log_task_event

Nice.

@eladkal
Copy link
Contributor

eladkal commented Nov 5, 2024

@dirrao what is the status of this PR?

@dirrao
Copy link
Contributor Author

dirrao commented Nov 6, 2024

@dirrao what is the status of this PR?

I’ve implemented the changes on the Kubernetes executor to align with the new base executor feature. However, I’m uncertain about how to adapt these updates in the Kubernetes watcher code.

@amoghrajesh
Copy link
Contributor

@dirrao why do you need to push anything to the watcher here?
You writing logs to the task logs should be sufficient right? or am missing something

@dstandish
Copy link
Contributor

TaskContextLogger is removed from airflow; this PR needs to be updated to use the log table. The feature was added in this pr #40867 and you can see an example of its usage there.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 10, 2025
@github-actions github-actions bot closed this Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Kubernetes Executor side task attempt logging for failed tasks in case of task pods doesn't reach running state

5 participants