Skip to content

Fix log tailing issues with legacy log view #29496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dstandish
Copy link
Contributor

@dstandish dstandish commented Feb 12, 2023

Probably we should just chop this view in favor of grid view logging which is the future. But this fixes rendering issues raised here #29447 (comment).

What we do, is in log tailing context (which apparently isn't used in grid, and that's why I did not see this in developing trigger logging) we don't add the messages to the log content. So, whenever log_pos is in metadata we don't add messages. It means the messages could be a bit stale but that seems ok. Refreshing the page could fix that. Longer term, we could update the API so that log content is just content and the messages are themselves returned in the metadata dict. That's probably the "right" solution ultimately. But can be saved for another day. Also resolve the "cannot load lazy instance" issue when invoking the reader logic from this different context.

Video:

legacy-log-stream-fix.mov

Probably we should just chop this view in favor of grid view logging which is the future. But this fixes rendering issues raised here apache#29447 (comment).

What we do, is in log tailing context (which apparently isn't used in grid, and that's why I did not see this in developing trigger logging) we don't add the messages to the log content.  So, whenever log_pos is in metadata we don't add messages.  It means the messages could be a bit stale but that seems ok.  Refreshing the page could fix that.  Longer term, we could update the API so that log content is just content and the messages are themselves returned in the metadata dict.  That's probably the "right" solution ultimately.  But can be saved for another day.  Also resolve the "cannot load lazy instance" issue when invoking the reader logic from this different context.
@boring-cyborg boring-cyborg bot added area:logging area:webserver Webserver related Issues labels Feb 12, 2023
@dstandish dstandish marked this pull request as ready for review February 12, 2023 21:45
@dstandish dstandish requested a review from Taragolis February 13, 2023 17:27
Copy link
Contributor

@Taragolis Taragolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally. Looks good!

Comment on lines +1531 to +1534
TaskInstance.task_id == task_id,
TaskInstance.dag_id == dag_id,
TaskInstance.execution_date == execution_date,
TaskInstance.map_index == map_index,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhhh... This view still use execution_date instead of run_id (not related to this PR)

@dstandish
Copy link
Contributor Author

Tested it locally. Looks good!

Super, thank you

@dstandish dstandish merged commit 7cf5cea into apache:main Feb 17, 2023
@dstandish dstandish deleted the fix-legacy-logs-view-in-streaming-context branch February 17, 2023 07:00
@pierrejeambrun pierrejeambrun added the type:bug-fix Changelog: Bug Fixes label Feb 27, 2023
@pierrejeambrun pierrejeambrun added this to the Airflow 2.5.2 milestone Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logging area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants