dabla commented on code in PR #65622:
URL: https://github.com/apache/airflow/pull/65622#discussion_r3139874612


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -912,14 +912,20 @@ async def _aget_response(self, expect_id: int) -> 
ToTriggerRunner | None:
             raise RuntimeError(f"Response read out of order! Got {frame.id=}, 
{expect_id=}")
         return self._from_frame(frame)
 
-    async def asend(self, msg: ToTriggerSupervisor) -> ToTriggerRunner | None:
+    async def _asend(self, msg: ToTriggerSupervisor) -> ToTriggerRunner | None:
         frame = _RequestFrame(id=next(self.id_counter), body=msg.model_dump())
         bytes = frame.as_bytes()
+        self._async_writer.write(bytes)
+        return await self._aget_response(frame.id)
 
+    async def asend(self, msg: ToTriggerSupervisor) -> ToTriggerRunner | None:

Review Comment:
   What does Claude say? To me the code looks good imho. It would be good to 
add logging errors and possibly stacktrace from logging, so it’s documented in 
the PR.  When I did the fix reported by TP, Claude helped me write a unit test 
to cover for regression in the future, as always its not easy to reproduce 
concurrenncy issues.
   
   Still I think the CommDecoder should have like some kind of generic 
(protected) send method so the locking is done at one central place, now its 
duplicated at 2 different classes for the same method. Or we write a decorator 
which handles the locking for sync/async, dunno if its possible though.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to