njnu-seafish commented on PR #18549:
URL: 
https://github.com/apache/dolphinscheduler/pull/18549#issuecomment-5350742991

   > ### Make task-result alert persistence idempotent
   > `TaskExecutorEventListenerImpl#onTaskExecutorSuccess` persists the alert 
immediately after publishing `TaskSuccessLifecycleEvent`, before the success 
event has been processed and acknowledged.
   > 
   > Task-executor lifecycle events use at-least-once delivery: the Worker 
retains and retries a success event until it receives the ACK from 
`TaskSuccessLifecycleEventHandler`. If the ACK is delayed or lost, or the 
Master fails after inserting the alert but before sending the ACK, the same 
success event is processed again and `alertDao.addAlert()` inserts another 
task-result alert. The alert may also be persisted even if the asynchronous 
success state transition is later rejected.
   
   You've made a really thorough point. That duplication issue can indeed 
happen, and I've already fixed it.
   Make task-result alert persistence idempotent and post-state-transition
   
   <img width="809" height="211" alt="screenshot_1787194125766" 
src="https://github.com/user-attachments/assets/ba41127f-9cfc-490c-ae22-e6da02ce01c9";
 />
   


-- 
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