- Notifications
You must be signed in to change notification settings - Fork5.2k
Commitff181d1
oauth: Remove stale events from the kqueue multiplexer
If a socket is added to the kqueue, becomes readable/writable, andsubsequently becomes non-readable/writable again, the kqueue itself willremain readable until either the socket registration is removed, or thestale event is cleared via a call to kevent().In many simple cases, Curl itself will remove the socket registrationquickly, but in real-world usage, this is not guaranteed to happen. Thekqueue can then remain stuck in a permanently readable state until therequest ends, which results in pointless wakeups for the client andwasted CPU time.Implement comb_multiplexer() to call kevent() and unstick any staleevents that would cause unnecessary callbacks. This is called rightafter drive_request(), before we return control to the client to wait.Suggested-by: Thomas Munro <thomas.munro@gmail.com>Co-authored-by: Thomas Munro <thomas.munro@gmail.com>Reviewed-by: Thomas Munro <thomas.munro@gmail.com>Backpatch-through: 18Discussion:https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com1 parent4cd9d5f commitff181d1
1 file changed
+61
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1379 | 1426 | | |
1380 | 1427 | | |
1381 | 1428 | | |
| |||
2755 | 2802 | | |
2756 | 2803 | | |
2757 | 2804 | | |
2758 | | - | |
2759 | | - | |
2760 | | - | |
2761 | | - | |
2762 | | - | |
| 2805 | + | |
| 2806 | + | |
2763 | 2807 | | |
2764 | | - | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
2765 | 2820 | | |
2766 | 2821 | | |
2767 | 2822 | | |
| |||
0 commit comments
Comments
(0)