<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 29, 2022, at 2:47 AM, Maxim Kartashev <<a href="mailto:mkartashev@openjdk.org" class="">mkartashev@openjdk.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">FSEventStreamCreate</span></div></blockquote></div><br class=""><div class="">This is sounding somewhat similar to the kqueue watcher I attempted. It was suggested this was due to maxing out file descriptors. Which seems plausible. What I would see was that suddenly the kernel would cease sending events at all.</div><div class=""><br class=""></div><div class=""><a href="https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate" class="">https://developer.apple.com/documentation/coreservices/1443980-fseventstreamcreate</a></div><div class="">The number of seconds the service should wait after hearing about an event from the kernel </div><div class=""><br class=""></div><div class="">Note this indicates it is still based on receiving events from the kernel. The following was my code, it shows originally I did no polling at all but changed it to do polling thinking this was a thread deadlock issue. But with polling my thread continued to run, it was the kernel that totally stopped sending events. Again this seems potentially similar to what is being described for errors here. It occurred in trying mine on the LotsOfEvents test. Maybe there would be some way you could check for this situation? The errors all seem to be timeouts when things stop happening, or I suppose happen but are missed? </div><div class=""><br class=""></div><div class="">-(void)<span class="Apple-tab-span" style="white-space:pre"> </span>watcherThread: (id)sender<br class="">{<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>int<span class="Apple-tab-span" style="white-space:pre"> </span>n;<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>int <span class="Apple-tab-span" style="white-space:pre"> </span>idle_cnt = 0;<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>struct kevent64_s ev;<br class=""> struct timespec timeout = { 5, 0 }; // 5 seconds timeout.<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>int<span class="Apple-tab-span" style="white-space:pre"> </span>theFD = queueFD;<span class="Apple-tab-span" style="white-space:pre"> </span>// So we don't have to risk accessing iVars when the thread is terminated.<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>struct timespec<span class="Apple-tab-span" style="white-space:pre"> </span>nullts = { 1, 0 };<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><br class=""> while( keepThreadRunning )<br class=""> {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>NS_DURING<br class="">//<span class="Apple-tab-span" style="white-space:pre"> </span>NSLog(@"going into kevent");<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>n = kevent64( queueFD, NULL, 0, &ev, 1, 0, &timeout );<br class="">//<span class="Apple-tab-span" style="white-space:pre"> </span>n = kevent64( queueFD, NULL, 0, &ev, 1, 0, &nullts );<br class="">//<span class="Apple-tab-span" style="white-space:pre"> </span>n = kevent64( queueFD, NULL, 0, &ev, 1, 0, NULL);</div></body></html>