Skip to content

Fix dumping container logs on error#19645

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-dumping-container-logs-on-error
Nov 17, 2021
Merged

Fix dumping container logs on error#19645
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-dumping-container-logs-on-error

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Nov 17, 2021

When we optimized tests for memory use we added cleanup of all
containers after each test suite. Unfortunately it caused
dumping container logs to stop working because this dumping was
done only only when the script was exiting.

This PR moves dumping container logs to between the test run and
cleanup, so that we can see the logs when there is a test failure.

Related to: #19633 where the logs were not dumped and it made the
analysis much more difficult.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Nov 17, 2021

cc: @khalidmammadov

@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Nov 17, 2021

You can see container logs nicely uploaded here: https://github.com/apache/airflow/actions/runs/1471691334

BTW. It would not help with diagnosing the problem we had - pinot logs are not showig anything suspicious. It looks like error was caused by bad health-check. I will add a docker ps command on failure so that we can match the container hash with the "health" check error (unfortunately the health check only shows HASH of the container that failed the health check)

When we optimized tests for memory use we added cleanup of all
containers after each test suite. Unfortunately it caused
dumping container logs to stop working because this dumping was
done only only when the script was exiting.

This PR moves dumping container logs to between the test run and
cleanup, so that we can see the logs when there is a test failure.

Related to: apache#19633 where the logs were not dumped and it made the
analysis much more difficult.
@potiuk potiuk force-pushed the fix-dumping-container-logs-on-error branch from 36681f4 to b71bf70 Compare November 17, 2021 13:50
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Nov 17, 2021

@ashb I saw you wanted to fix it before -the reason it did not work was that we cleaned-up containers to save memory and dumping container logs was executed after that 🤦 - this should help with diagnosing similar issues as with #19633

Copy link
Copy Markdown
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Yeah my change didn't work on timeout, likely because of this.

@potiuk potiuk merged commit 7cda7d4 into apache:main Nov 17, 2021
@potiuk potiuk deleted the fix-dumping-container-logs-on-error branch November 17, 2021 18:49
@github-actions github-actions Bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 17, 2021
@github-actions
Copy link
Copy Markdown
Contributor

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

potiuk added a commit that referenced this pull request Jan 22, 2022
When we optimized tests for memory use we added cleanup of all
containers after each test suite. Unfortunately it caused
dumping container logs to stop working because this dumping was
done only only when the script was exiting.

This PR moves dumping container logs to between the test run and
cleanup, so that we can see the logs when there is a test failure.

Related to: #19633 where the logs were not dumped and it made the
analysis much more difficult.

(cherry picked from commit 7cda7d4)
@potiuk potiuk added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Jan 22, 2022
@potiuk potiuk added this to the Airflow 2.2.4 milestone Jan 22, 2022
potiuk added a commit that referenced this pull request Jan 22, 2022
When we optimized tests for memory use we added cleanup of all
containers after each test suite. Unfortunately it caused
dumping container logs to stop working because this dumping was
done only only when the script was exiting.

This PR moves dumping container logs to between the test run and
cleanup, so that we can see the logs when there is a test failure.

Related to: #19633 where the logs were not dumped and it made the
analysis much more difficult.

(cherry picked from commit 7cda7d4)
jedcunningham pushed a commit that referenced this pull request Jan 27, 2022
When we optimized tests for memory use we added cleanup of all
containers after each test suite. Unfortunately it caused
dumping container logs to stop working because this dumping was
done only only when the script was exiting.

This PR moves dumping container logs to between the test run and
cleanup, so that we can see the logs when there is a test failure.

Related to: #19633 where the logs were not dumped and it made the
analysis much more difficult.

(cherry picked from commit 7cda7d4)
@potiuk potiuk restored the fix-dumping-container-logs-on-error branch April 26, 2022 20:47
@potiuk potiuk deleted the fix-dumping-container-logs-on-error branch July 29, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants