Skip to content

Comments

Add extra error handling to S3 remote logging (#9118)#9908

Merged
ashb merged 8 commits intoapache:masterfrom
JPonte:issue-9118
Nov 13, 2020
Merged

Add extra error handling to S3 remote logging (#9118)#9908
ashb merged 8 commits intoapache:masterfrom
JPonte:issue-9118

Conversation

@JPonte
Copy link
Contributor

@JPonte JPonte commented Jul 21, 2020

#9118

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

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.
Read the Pull Request Guidelines for more information.

@boring-cyborg boring-cyborg bot added area:logging provider:amazon AWS/Amazon - related issues labels Jul 21, 2020
@JPonte JPonte changed the title [AIRFLOW-9118] Add extra error handling to S3 remote logging Add extra error handling to S3 remote logging (#9118) Jul 21, 2020
@dimon222
Copy link
Contributor

This works very well!

@RosterIn
Copy link
Contributor

@feluelle can you check?

Copy link
Member

@feluelle feluelle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@feluelle feluelle requested a review from ashb August 31, 2020 09:15
@ashb
Copy link
Member

ashb commented Sep 1, 2020

Can you give me an example of what the log view now shows with an error?

@JPonte
Copy link
Contributor Author

JPonte commented Sep 1, 2020

Depending on the type of the error it might show:
*** Failed to verify remote log exists if the HEAD to the s3 object fails along with the error.
If the HEAD returns 404 (meaning that the log file doesn't exist in s3) it shows:
*** Falling back to local log.
And if the previous log to append fails to be read, it gets skipped.

@ashb
Copy link
Member

ashb commented Sep 1, 2020

Oh, so it doesn't include any of the error message from S3?

@JPonte
Copy link
Contributor Author

JPonte commented Sep 1, 2020

It shows the error from the HEAD:
'*** Failed to verify remote log exists {}.\n{}\n'.format(remote_loc, str(error))
Shows the supposed location of the remote log and the error.

Copy link
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.

Could you add a new test along the lines of test_read_when_s3_log_missing but when an error is returned.

@JPonte JPonte requested a review from ashb September 3, 2020 17:49
@stale
Copy link

stale bot commented Nov 1, 2020

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

@stale stale bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Nov 1, 2020
Copy link
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.

Sorry, missed the rereview request.

Lgtm

@stale stale bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Nov 1, 2020
@github-actions
Copy link

github-actions bot commented Nov 1, 2020

The PR should be OK to be merged with just subset of tests as it does not modify Core of Airflow. The committers might merge it or can add a label 'full tests needed' and re-run it to run all tests if they see it is needed!

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Nov 1, 2020
@feluelle
Copy link
Member

Sorry @JPonte but there are some conflicting files. Can you fix this? When you've done this I am merging it.

@JPonte
Copy link
Contributor Author

JPonte commented Nov 12, 2020

@feluelle done

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@feluelle
Copy link
Member

feluelle commented Nov 12, 2020

@JPonte there is an error with the Static checks

-            msg = 'Could not read logs from {} with error: {}'.format(remote_log_location, error)
+            msg = f'Could not read logs from {remote_log_location} with error: {error}'

We force to use f-strings

@JPonte
Copy link
Contributor Author

JPonte commented Nov 12, 2020

@feluelle Ah, my bad. Fixed again.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

Copy link
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.

Tests failing because of trailing spaces in strings

@ashb ashb merged commit c94b124 into apache:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging okay to merge It's ok to merge this PR as it does not require more tests provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants