-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Introduce separate channel for trigger workloads #48835
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
Introduce separate channel for trigger workloads #48835
Conversation
|
Does this approach okay? |
| child_comms, read_msgs = mkpipe() | ||
| child_logs, read_logs = mkpipe() | ||
|
|
||
| if "TriggerRunnerSupervisor" in cls.__name__: |
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.
Open these sockets only when in triggerer, for others we dont need it.
|
I'll take a closer look at this on Monday |
cool thanks :) |
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.
I just made a couple of nits
Makes sense to me, I'll let Ash have the final word on this.
| """" | ||
| It require special case to handle the workloads and api calls to api-server, due to mixing up messages | ||
| a separate channel is used to send the workloads from parent process to child process the child process. | ||
| connect_stdin will use this channel to read the workloads in read_workload method. | ||
| """ |
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.
If I remember correctly those should field docstring should go bellow the attr they describe, not above.
| ) | ||
|
|
||
| def _send(self, msg: BaseModel): | ||
| self.trigger_stdin.write(msg.model_dump_json().encode("utf-8") + b"\n") # type: ignore[union-attr] |
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 type ignore seems of. It wasn't necessary before and it seems really similar now:
|
Thanks @pierrejeambrun for review, will be closing this in favour of #48880 |
closes: #48820
realted: #48819 #48747
Why
Introducing a separate channel for trigger workloads.
Currently when multiple tasks are entering into trigger, the messages are mixing up with Trigger Workloads. this is due to the read side when we are trying to read same sys.stdin, causing this problem IMHO. When this mixing happens we are loosing the Trigger Workloads as its read in different place.
What
Created two new sockets to handle Trigger Workloads, when main process writes with
trigger_stdinand in child process this Workloads will be reading from thetrigger_requests_fdHave observed this behaviour while testing DagStateTrigger/WorkflowTrigger
Connections are failing to retrieve in Trigger, when multiple tasks running in tirgger.
After
Retrieved connections properly for all the task and their own connection id, have created a separate connection for each task to verify whether messages are mixing up or not. Looking good.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.