← Back to team overview

maria-discuss team mailing list archive

Re: Why isn't SO_SNDTIMEO used?


> On Wed, Mar 10, 2010 at 12:29 PM, Michael Widenius <monty@xxxxxxxxxxxx> wrote:
>> We also use the thr_alarm() functionality when one uses 'kill
>> connection-id' in MySQL.  I don't know of any easy way to gracefully
>> wake up a thread that is sleeping on SO_SNDTIMEO. Do you?

Well, I checked the code, and it seems to wake up the thread using
pthread_kill(thread, signal) for the 'kill connection-id' command. This should
work fine also when using SO_SNDTIMEO for timeouts on the socket.

Just send the signal to the thread blocking on the socket with SO_SNDTIMEO,
and the blocking socket call will return with EAGAIN or similar.

 - Kristian.

Follow ups