From https://lists.samba.org/archive/samba-technical/2022-September/137647.html: I've been trying to chase down the CPU spins reported by our users in the writev() codepath from our LDAP server. A private mail the the strace output shows the sockets are in CLOSE_WAIT state, returning EAGAIN over and over (after a call to epoll() each time). That alone would be enough to keep things spinning. But they are being shut down, however our LDAP server won't be triggering a read any time soon, it is waiting to flush the response out. Technically even after our server OS has got the FIN, there is potentially data in the read buffer (so a read() might not return 0 anyway), but perhaps most of the time that would be 0. So how can we detect this? Can we at least put a timeout on a writev() call via tsocket et al? If so, how do we do that? Mailing list threads: https://lists.samba.org/archive/samba/2022-September/241869.html https://lists.samba.org/archive/samba/2022-September/241873.html Andrew Bartlett
This bug was referenced in samba master: f0fb8b9508346aed50528216fd959a9b1a941409 9950efd83e1a4b5e711f1d36fefa8a5d5e8b2410 29a65da63d730ecead1e7d4a81a76dd1c8c179ea 4c7e2b9b60de5d02bb3f69effe7eddbf466a6155 e232ba946f00aac39d67197d9939bc923814479c eb2f3526032803f34c88ef1619a832a741f71910
Created attachment 17589 [details] Patch for Samba 4.16
Created attachment 17590 [details] Patch for Samba 4.17
Created attachment 17605 [details] Patch backported to Samba 4.12 The 4.12 patches are included in this tree (so was tested with the other patches in this tree): https://gitlab.com/catalyst-samba/samba/-/releases/catalyst-4.12-backports-2022-10
Pushed to autobuild-v4-{17,16}-test.
This bug was referenced in samba v4-17-test: dcac415e9493fe14eb0972ac0c97f66b02a232d0 8a4ef3d92e7df83245a76a2396ee328a940a1cf2 5c051d3806521e2e25a2a8a1e459d1d69722c96f 419986dcc0bc850e82f1d0229fbe57a3be8bb59e b615bf4333a1a1a3c80bd93a186f1a137c8b13dc 743a56e5ccf358deb7b7093c55ea796e7000de3f
This bug was referenced in samba v4-16-test: c805ccba33985ca07da63b4be3affafb495e13a1 119bf609985a873346891c5ca55e69178d712eb0 d8d5146d1679383747ad0533759f97020b78221e aeb7dd2ca89e7a010baaf3a5da17eaa466ace06e bc16a8abe3f1446a0da7e672cdba469fcc8ef96a f7a84cffe9d9c61df7a7c5dd94e9caf3d18d9b3c
Closing out bug report. Thanks!
This bug was referenced in samba v4-17-stable (Release samba-4.17.4): dcac415e9493fe14eb0972ac0c97f66b02a232d0 8a4ef3d92e7df83245a76a2396ee328a940a1cf2 5c051d3806521e2e25a2a8a1e459d1d69722c96f 419986dcc0bc850e82f1d0229fbe57a3be8bb59e b615bf4333a1a1a3c80bd93a186f1a137c8b13dc 743a56e5ccf358deb7b7093c55ea796e7000de3f
This bug was referenced in samba v4-16-stable (Release samba-4.16.8): c805ccba33985ca07da63b4be3affafb495e13a1 119bf609985a873346891c5ca55e69178d712eb0 d8d5146d1679383747ad0533759f97020b78221e aeb7dd2ca89e7a010baaf3a5da17eaa466ace06e bc16a8abe3f1446a0da7e672cdba469fcc8ef96a f7a84cffe9d9c61df7a7c5dd94e9caf3d18d9b3c
This bug was referenced in samba master: 5bedf1675e7b5a960f34beef87da79cad5b696a6