-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix setproctitle usage
#53122
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
Fix setproctitle usage
#53122
Conversation
|
Might need a second pair of eyes, but LGTM |
kaxil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, like @amoghrajesh mentioned that this is duplicated purposely to not have dependency for it between Core, SDK & Providers
|
So I need to wait until the PR for code sharing of "core", "task-sdk" and "provider" described in Dev Mail: Code sharing between Airflow Core and Task SDK - how do we achieve it then keep on this right ? |
The code is too small IMO -- duplication is not always bad :) We can leave this as-is and close this PR |
I see! I’ll remove this small new module as I was previously a bit stuck trying to avoid duplication. |
d918926 to
2a025af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, but maybe I missed something.
edit: Just saw other comments, code duplication it is. We can still leave that at the top of each file to avoid duplication within the same file. (which shouldn't bring any cross component dependencies)
2a025af to
7c758fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I see the PR is on draft is there anything left you wanted to implement there
No, thanks for the reminder, I just want to make sure the CI is green before marking the PR as ready to review. |
7c758fa to
56af22a
Compare
|
Hi @kaxil, this PR still needs your approval to resolve the requested changes. Thanks! |
56af22a to
b4786a2
Compare
|
It seems that this PR still needs @kaxil's approval before it can be merged. |
|
Other committers can dismiss reviews. I've just done that, and let me give it a re-review. |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good to me. I'll let @ashb give the final word on this as requested
potiuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That calls a little for a "shared" distribution to include that code rather than copy it over. But it'a little to small to do it now. But maybe eventually when we expand on our "shared" projects concept we could have a separate "executors base" code an we split out executors to separately installable distributions, we could make the code implemented once. Maybe worth leaving TODO for that ?
Just a suggestion - not a blocker at all.
|
@potiuk I see it differently, and I'd say this is one of the cases where not using a shared dist and duplicating the code is better for readability -- this sort of case is exactly what I had in mind when I wrote this https://github.com/apache/airflow/tree/main/shared#be-thoughtful-about-what-you-add-under-here
|
related: #52860
Why
When using
setproctitlewe should skip MacOS (darwin) as special case, see benoitc/gunicorn#3021 for more detail.When refactoring in #52860, I found there are duplicate code to handle
setproctitlefor MacOS and some usage ofsetproctitledon't handle the MacOS problem, which might lead to error.What
setproctitleutility in theairflow.utilsmodule to centralize handling of the macOS error, allowing us to avoid the issue from the beginning.