eshaanjain26 commented on issue #14127:
URL: 
https://github.com/apache/trafficserver/issues/14127#issuecomment-7111502937

   Posting as an investigation note, having reviewed the startup sequence 
described here:
   
   **On the three questions asked:**
   
   1. **Can a UDP worker finish initialisation before the callback is 
registered?** Yes, on the code as shown. `udpNet.start()` starts the ET_UDP 
thread group, and `EventProcessor::thread_started()` invokes 
`_afterStartCallback` at thread start. If the assignment 
`thread_group[ET_UDP]._afterStartCallback = init_HttpProxyServer` has not 
executed yet when the last UDP thread passes that point, it reads a null 
callback and the notification is simply not delivered. There is no latch or 
replay: nothing re-checks the callback after assignment.
   
   2. **Would that leave main waiting indefinitely?** That follows from the 
readiness design. With QUIC enabled, main waits on `et_udp_threads_ready`, 
which is only set from the callback path. A lost callback is not a delayed 
callback — no later event in the sequence re-arms it — so the wait has no 
natural exit, which matches the observed symptom: process alive, no "fully 
initialized" message, timeout at 60s.
   
   3. **Is moving registration before `start()` the appropriate fix?** It is 
the minimal correct fix, and it matches how ET_NET is already handled in the 
same startup path, so it also makes the two thread groups consistent. The 
reorder removes the race window entirely rather than narrowing it: the callback 
is visible before any worker can run.
   
   **Two additions worth considering with the fix:**
   
   - A regression test does not need a full ATS reproducer. The scheduling 
harness in the report already demonstrates the lost notification 
deterministically at the callback level. A unit-level test that starts a thread 
group with the callback registered after start, using a barrier to force the 
worker to finish first, would lock in both the bug and the fix at that level, 
even while a full-system reproducer remains elusive.
   - As defence in depth, the readiness wait could log which thread groups it 
is still waiting on when startup exceeds a threshold. In the observed failure 
there were no thread backtraces, so the next occurrence will again be hard to 
attribute; a "waiting on ET_UDP readiness" diagnostic would have named the 
cause directly.
   
   I am happy to test a patch build in the harness arrangement above, or to 
review the change, if that would help move this forward.
   
   — Eshaan Jain, independent researcher (IEEE Senior Member)


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