-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-6569] Flush pending Sentry exceptions before exiting forked process #7232
[AIRFLOW-6569] Flush pending Sentry exceptions before exiting forked process #7232
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! Here are some useful points:
Apache Airflow is a community-driven project and together we are making it better 🚀. In case of doubts contact the developers at: |
Hahah I was just working on an almost identical solution. Nice one :-) |
Codecov Report
@@ Coverage Diff @@
## master #7232 +/- ##
===========================================
+ Coverage 33.23% 88.01% +54.78%
===========================================
Files 935 935
Lines 45170 45177 +7
===========================================
+ Hits 15010 39764 +24754
+ Misses 30160 5413 -24747
Continue to review full report at Codecov.
|
Does this need a specific version of the sentry library to work? |
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. |
Any chance you could rebase this again? Cheers |
3408e42
to
212485b
Compare
Rebased again, thanks for the heads up. |
261facf
to
7b46d39
Compare
I believe the bug this patch addresses is actively preventing us from receiving alerts in production. |
I second this affecting our alerting. |
When can we expect this bug fix to get merged? |
@tiopi @AbhiPrasad Can I ask for review? Can you share your experience with applications that use fork and Sentry? |
Yeah these changes LGTM, and are in line with how we have to use the python sdk until we add extended |
7b46d39
to
1d19d01
Compare
Rebased master just now - last time the tests were failing for unrelated reasons, but we'll see. |
It seems like the tests that are failing are unrelated to this patch and seem to be the same tests that are also failing on master. What's blocking merging this in at this point? |
Can you do rebase to the latest master? I would like to accept these changes, but I need green tests (excluding quarantine) |
Fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling `os._exit` within the forked task runner.
1d19d01
to
b113457
Compare
Rebased again, thanks. |
Awesome work, congrats on your first merged pull request! |
@mikeclarke thanks a lot for the fix. @mik-laj , do you know if this fix will go out in the next release 1.10.11? Many thanks |
@kaxil do you have any information about it? |
Yes can be included in 1.10.11 |
@kaxil , thank you for information and add to milestone "Airflow 1.10.11". |
Fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling `os._exit` within the forked task runner. (cherry picked from commit db70da2)
Fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling `os._exit` within the forked task runner. (cherry picked from commit db70da2)
Fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling `os._exit` within the forked task runner. (cherry picked from commit db70da2)
Fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling `os._exit` within the forked task runner. (cherry picked from commit db70da2)
After switching to
os.fork()
for the task runner, there is the possibility that exceptions queued by Sentry will not be emitted prior to the process exiting.This fixes AIRFLOW-6569 by explicitly flushing pending exceptions prior to calling
os._exit()
within the forked task runner.This is covered by existing unit tests within
tests/task/task_runner/test_standard_task_runner.py
.Issue link: AIRFLOW-6569
Make sure to mark the boxes below before creating PR: [x]
[AIRFLOW-NNNN]
. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX]
.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.