Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66325 invoked from network); 14 Nov 2013 21:34:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2013 21:34:24 -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.217.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:56293] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/D2-53459-FD145825 for ; Thu, 14 Nov 2013 16:34:24 -0500 Received: by mail-lb0-f176.google.com with SMTP id p9so2023094lbv.7 for ; Thu, 14 Nov 2013 13:34:20 -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=T5WQycrceJMlS3h2xccXckRb/Y2IPl3EE9ArNG0wHlU=; b=cRz1fg7k4nPVdh5sl4RI0xzYLmnLdgf1m61CQ+sK9fxDO8lWebF0L4pSLyeYj4g4XA G/JEWtmGKcBlWAgvnKmSGqQb0BqBPwBauXhTqLHhbWsCtpe3Xq0tssvxb7K9hRAo/6WN 7702CsBTVua2Kkz+YKw4jnk05SsaFh6QweZwyiH9KpCcnPxNJ4Bq4dae7PihLRV8zXA3 mBRGnFbOFK/RioHdQwOXhuu+eKsBEnJvBTzypK3/xOtr7Ejw/ILIJ2wg+d20oqj6rZPJ lKMkRIkQtYI+30aJ6tIQTWBwC4ItUN0Kak7Xi24LSUrXdgzOBMeaWY8JKCnKTw6vtdvM PC6w== X-Received: by 10.152.170.133 with SMTP id am5mr2039252lac.9.1384464860528; Thu, 14 Nov 2013 13:34:20 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Thu, 14 Nov 2013 13:33:40 -0800 (PST) In-Reply-To: References: <5285390D.6000106@sugarcrm.com> <52853E69.5040104@sugarcrm.com> Date: Fri, 15 Nov 2013 06:33:40 +0900 X-Google-Sender-Auth: 5tfWtys2S1WIKbl04QYgEvTXFjI Message-ID: To: Adam Harvey Cc: Stas Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0117720f37464a04eb29d82b Subject: Re: [PHP-DEV] Session cache, lock and write From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0117720f37464a04eb29d82b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Adam and Stas, On Fri, Nov 15, 2013 at 6:25 AM, Adam Harvey wrote: > On 14 November 2013 13:19, Stas Malyshev wrote: > >> I think you've wrote this before I sent new mail. For files save > handler, > >> when session.lock=3DOff, it will be > >> > >> open-and-lock -> read session data -> close-and-unlock -> > >> script executed > >> -> open-and-lock -> write session data -> close-and-unlock > > > > I don't think this is a very good idea, since what happens if somebody > > else changed the state while script was executing? That change would be > > killed by the write. The lock is not for writing, the lock is for data > > consistency between reading in writing. If you gave up the lock, you > > should not write afterwards because your data may be stale. > > I can see situations where that might be useful =E2=80=94 where it's not = so > important if the write gets clobbered so long as there's minimal > locking to ensure that the session file is at least valid. > > I'm still on the fence about whether it's actually a useful thing to > support in php-src, though. It might be enough of a corner case to not > make it worth supporting in a bundled session handler, and I'm worried > the people might start giving advice that using it will "speed up your > application" and users who copy-paste configurations will silently > usedata. > > As an aside, if we do implement it: Yasuo, you've convinced me that > session.lock is a reasonable name (instead of being handler-specific). > :) Memcached/Memcache/MongoDB session save handlers already have lock option. I think not few users are used to it already. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0117720f37464a04eb29d82b--