compnerd added a comment.

I was able to play around with this further yesterday evening.  You are correct 
- the issue is the load preventing the watcher thread from spinning up.  I was 
able to reproduce this issue and resolve it by adding in a synchronization 
point (boolean + mutex + condition variable) before returning the directory 
watcher to ensure that the RDC was setup.  I looked through all the previous 
failure cases as well as the one that I was finally able to reproduce - it is 
always the initial notification that we missed (because the thread took too 
long to come up).  In the process I did do a few minor alterations as well.  I 
would like to get additional testing over the weekend on the bots so people 
aren't impacted if there turns out to be some other subtle threading issue.  
However, running this in a tight loop locally seemed to be pretty stable 
(switching the builds to a SSD locally did help uncover the flakiness) so I am 
confident that this should be safe.  I'm happy to address any additional 
comments in post-commit review.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88666/new/

https://reviews.llvm.org/D88666

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to