Unix domain datagram based messaging

Stefan (metze) Metzmacher metze at samba.org
Thu Apr 10 05:24:48 MDT 2014


Am 10.04.2014 12:26, schrieb Volker Lendecke:
> On Wed, Apr 09, 2014 at 02:28:19PM -0700, Jeremy Allison wrote:
>> It's removing most of our signal issues,
>> which is great ! However, at least within
>> smbd we still have to handle slow system
>> calls returning -1,EINTR if we get hit
>> by POSIX realtime signals from the leases
>> (of course due to this patchset this should
>> now be *extremely* rare :-)
>>
>> So shouldn't:
>>
>> recv() in unix_dgram_recv_handler()
>> connect() in unix_dgram_send_queue_init()
>> send() in unix_dgram_send_job()
>> sendmsg() in unix_dgram_send()
>>
>> in this patchset be changed to handle -1,EINTR with
>> an immediate retry ?
> 
> I'm always a bit reluctant to add these unconditional loops,
> because it postpones signal handling unnecessarily and makes
> Ctrl-C not work as expected. For the syscalls that are
> called from the central event loop, shouldn't we try to make
> sure that we handle EINTR in the sense that the call just
> did not happen? The event loop should come back to us
> immediately again, the socket should still be ready as seen
> by poll. You're right, I have not thought about this yet at
> all, so some modifications are required. I just don't know
> if the hard retry is the right thing in this very lowlevel
> library.

Yep, I think we can just handle it like EAGAIN.

metze


More information about the samba-technical mailing list