Re: Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory

From: Date: Thu, 30 Jan 2014 07:39:21 +0000
Subject: Re: Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

> Some syscalls can fail with EINTR, when a signal hits while within the
> kernel. This is especially true for flock(LOCK_EX) because in the
> already-locked case the second call will go to sleep for a while waiting
> for the lock to clear. But it is also possible, I think, for the
> pread/read/write calls. The usual handling for the case (-1 return &&
> errno
> == EINTR) is to just repeat the call in a while loop. I think that at
> least
> doing so for the LOCK_EX calls, would be prudent.

Re-Read the manpage (*) a bit... read/pread/write should be safe here, going 
to disk, and not a pipe or socket. But flock() will return EINTR when 
signalled and the signal handler did not use SA_RESTART. Most PHP execution 
will _probably_ okay anyway as $restart_syscalls is default true for 
pcntl_signal(), but handling would be safer anyway.

Patrick

(*) search for SA_RESTART in http://man7.org/linux/man-pages/man7/signal.7.html


Thread (42 messages)

« previous php.internals (#71786) next »