Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62984 invoked from network); 30 Jan 2014 07:32:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2014 07:32:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:42409] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/44-42724-2100AE25 for ; Thu, 30 Jan 2014 02:32:34 -0500 Received: by mail-la0-f44.google.com with SMTP id hm7so2265605lab.17 for ; Wed, 29 Jan 2014 23:32:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=uJs6idWq89AyI4p18u/ijZVBnjZdU6HEftrtnsCHAsc=; b=l5cw6fNO32dqm0S5sNag83s6kjESK4CfqO46hamFDfd6zn8iLtipMhCi0sgoLlgh7N gzv91MNDT4Ely45WxsTMcotViNhZeIiTsNavkjZv5CCRPb2JhEmpG8ciBaL1dykRwwWs p8umLIiCsw5/EK+aRK9ZLcT2KdRmhOFORdDwATvNjymtL/MnmRPSsBSQvGQTOILszREy WUUhNhjsflQZtuJ34Z981a1OKIU7xj++AY/f95US4VcDkn0NGlGypYghLhxMIyvnBtTx RxmGi/pgDi22r5CgMZ4o2UdsiVkOl+z3GTlIAtwGKcmezTm57MNjMnw11+uzub7UL1/C XX6Q== X-Received: by 10.152.5.199 with SMTP id u7mr8819873lau.16.1391067151330; Wed, 29 Jan 2014 23:32:31 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 29 Jan 2014 23:31:51 -0800 (PST) In-Reply-To: References: <52E9A631.5050808@sugarcrm.com> <18069656.FoN8fZuO6C@rofl> Date: Thu, 30 Jan 2014 16:31:51 +0900 X-Google-Sender-Auth: Qx7BUq3gYTPCcQOVJA0hmdfFulw Message-ID: To: Patrick Schaaf Cc: internals Content-Type: multipart/alternative; boundary=089e013d1a7869ef9b04f12b0f48 Subject: Re: [PHP-DEV] Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e013d1a7869ef9b04f12b0f48 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi all, On Thu, Jan 30, 2014 at 4:17 PM, Yasuo Ohgaki wrote: > On Thu, Jan 30, 2014 at 3:37 PM, Patrick Schaaf wrote: > >> Unrelated to the previous discussion, and applicable to the base PHP cod= e >> in mod_files.c too, another observation: >> >> 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 && er= rno >> =3D=3D EINTR) is to just repeat the call in a while loop. I think that a= t least >> doing so for the LOCK_EX calls, would be prudent. >> >> best regards >> > I also notice other issue when closely looking at current code. > It does > > open() > =E2=86=93 > read() - locked > =E2=86=93 > script execution > =E2=86=93 > write() - unlock > =E2=86=93 > close() > > However, when write() is called, it always close opened fd to address > changed session ID. > This logic will likely to create race condition that reads old session > data before writing. > > I'll address this issue as other issue to be fixed. > > In short, session data access is not serialized like serializable > transaction isolation level. > It seems we have to keep all opened fd until session is really closed. It requires rather large change. I'll fix this issue when this RFC is done. Is anyone has better idea rather than keeping all fds? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e013d1a7869ef9b04f12b0f48--