Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71786 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64519 invoked from network); 30 Jan 2014 07:39:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2014 07:39:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:41388] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/94-42724-EA10AE25 for ; Thu, 30 Jan 2014 02:39:27 -0500 Received: (qmail 28142 invoked by uid 1009); 30 Jan 2014 08:39:22 +0100 Received: from 213.135.15.139 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/18413. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:0(213.135.15.139):SA:0(-1.1/10.0):. Processed in 0.75485 secs); 30 Jan 2014 07:39:22 -0000 X-Spam-Status: No, hits=-1.1 required=10.0 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:0(213.135.15.139):SA:0(-1.1/10.0):. Processed in 0.75485 secs Process 28134) Received: from unknown (HELO rofl.localnet) (gmail@bof.de@213.135.15.139) by mars.intermailgate.com with AES256-SHA encrypted SMTP; 30 Jan 2014 08:39:22 +0100 To: Yasuo Ohgaki Cc: internals Date: Thu, 30 Jan 2014 08:39:21 +0100 Message-ID: <1901754.VIxmjGKhhM@rofl> User-Agent: KMail/4.11.5 (Linux/3.13.0-k10-bof; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [PHP-DEV] Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory From: php@bof.de (Patrick Schaaf) > 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