Conversation
|
Well, this appears to fix the issue. I'll spend some time trying to understand why so I can de-Claude it next week. |
Use epoll(7) edge-triggered mode to return notifications only when events change. Fixes: swhitty#186
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #187 +/- ##
=======================================
Coverage 92.80% 92.80%
=======================================
Files 68 68
Lines 3448 3448
=======================================
Hits 3200 3200
Misses 248 248 ☔ View full report in Codecov by Sentry. |
|
I've reviewed Claude's changes, I think they're OK (with a bit of cleaning up), another approach would be to continue using level-triggered mode but with |
|
Standby, test failures with patch. |
200ce48 to
4673ad0
Compare
|
Hmm, I don't seem to have a fix that both passes tests and solves the high CPU usage issue. I'm going to have spend a bit more time investigating it which may take a while to get around to. |
|
Thanks for looking into this — edge triggered may be the best solution but it also may require a larger refactor — currently sockets are added to the queue (Kqueue / ePoll) when they are blocked and removed when they are unblocked. The window of time between receiving If switching to edge triggering we may need to add |
Possible fix for #186, but note this was done by Claude and I have not reviewed it myself (indeed I don't really know enough about
epoll(7)to do so).