Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78757 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22832 invoked from network); 5 Nov 2014 23:23:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2014 23:23:54 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.214.180 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:39620] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/B0-18902-781BA545 for ; Wed, 05 Nov 2014 18:23:52 -0500 Received: by mail-ob0-f180.google.com with SMTP id wp4so1445012obc.39 for ; Wed, 05 Nov 2014 15:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ffEkfgRafMKEsmC6wuznh64uKvedThomOXzRlLUwQXE=; b=r+1Fwuo0a3b5oYbKm3HNjepnibDqmtOH6TCDyZlTIF07GIJqru7V83i9z0/OsK8n5z PwbeFjpU1LwIiTLYaOC5Z2mFBVjBBPySVV+hX5SioAawwRnAwkW2U25G2S3kx2Y6KhUk 5GC+t4MIEIt6t1eucV0z7vNYM6l2oTwQaMPeg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ffEkfgRafMKEsmC6wuznh64uKvedThomOXzRlLUwQXE=; b=gnvJkxJNeCT9ijXtrL39P7qlcQCn0/Cojl2Ix92aOx4zVGj3o3t3IA2w18T2CcDoJi FKJKI7RSIW1i5F4ABuRdfuc1byqjDec3Dupq/oz1bku0zzLH5UCn7J78qi5D1qFqGLcD MjbsgTSFMxROlkpOJqDzI2br0BIy8+Pum0z9FKESfM3EpzgK/436Ka5qPPeMjOBbyr0k OxHxmL6c8y5SWnnBngzzFi7osbsv/9Ku65/esoaZDahKb+2Np2bg5AKo4KBEj+CYDp8V c3U53CzIG98t+0q1tvWuq7yAA0Ty0Acohfcnz2e52fHF0ZFthVe2y7WGjTxd8A0ejJJO 3S3g== X-Gm-Message-State: ALoCoQkUQxkpzZ4nSdZSlVxr5HYzhzP7+I8EageJeCeo9/REqfm8ik3Wibz66hH5akFK/H3UltaJ MIME-Version: 1.0 X-Received: by 10.202.63.137 with SMTP id m131mr271520oia.75.1415229829235; Wed, 05 Nov 2014 15:23:49 -0800 (PST) Received: by 10.202.75.148 with HTTP; Wed, 5 Nov 2014 15:23:49 -0800 (PST) In-Reply-To: References: <424081508.1350448.1415209726279.JavaMail.zimbra@escapemg.com> <801152711.1350497.1415209768109.JavaMail.zimbra@escapemg.com> Date: Thu, 6 Nov 2014 01:23:49 +0200 Message-ID: To: Ferenc Kovacs Cc: Mark Caudill , Yasuo Ohgaki , julien pauli , Damian Wadley , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Lazy writing in the session, session-lock-ini, and bug #68331 From: narf@devilix.net (Andrey Andreev) Hi all, On Wed, Nov 5, 2014 at 9:52 PM, Ferenc Kovacs wrote: > > Hi, > > thanks for the report. > first let me clarify a couple of things: > > 1, neither of https://wiki.php.net/rfc/session-lock-ini or > https://wiki.php.net/rfc/session-read_only-lazy_write made into 5.6 in their > proposed forms > 2, the changes about the write short circuit (and session_gc() and > session_serializer_name()) and the lack of consensus went under the radar > originally, as it was commited to master before 5.6. > > sometimes later the write short circuit one was spotted, and Yasuo was asked > to make a proper rfc about it, which lead to the creation of > session-lock-ini rfc which didn't got much attention originally, but the > option which passed was basically the same thing which was committed before, > plus an optional argument for session_start which controlled the behavior. > this rfc was not followed up on though, and this was spotted by Andrey who > pointed out the discrepancies about the session related changes and asked > the list to reconsider the inclusion of those: > http://grokbase.com/t/php/php-internals/143brgjp9d/revert-session-serializer-name-session-gc > http://grokbase.com/t/php/php-internals/143fagz0a7/rfc-revert-extend-postpone-original-rfc-about-read-only-lazy-write-sessions > http://grokbase.com/t/php/php-internals/143r244qtr/rfc-session-start-read-only-lazy-write-take-2 > > a lengthy discussion broke out and Yasuo reverted the changes about > session_gc() and session_serializer_name() which was introduced without > prior discussion, and there were some more discussion about the committed > write short circuit and the accepted but not yet merged lazy_write, which > also triggered the creation of > https://wiki.php.net/rfc/session-read_only-lazy_write but in the end, > nothing was done, neither of reverting the original short circuit nor > properly exposing this to the userland session handler. > > We also had a last minute blocker issue because of the write short > circuit(https://bugs.php.net/bug.php?id=67694) but I guess we were too > focused on shipping 5.6 at that point to take a step back and reconsider > reverting/refining this small performance improvement before the 5.6.0 > final. > > I cc'ed Julien(the other RM for 5.6), Yasuo (the original author of the > change in question) and Andrey(who was the most vocal and active person > discussing the lazy write changes with Yasuo and the author of the > https://wiki.php.net/rfc/session-read_only-lazy_write rfc), and I would like > to hear your opinion on the situation at hand. > Personally I think that we can have 3 options: > > 1. keep everything as is, including the perf gain for those using the default > session handler and risk the potential problems for others (for example some > cache/memcache based handlers could be expecting the session write handler > to be called to not let active but unmodified sessions to be expired/purged > from the cache). (we keep a potential BC break and if you need to work > around you have to do some acrobatics) > 2. introduce a better interface for custom handlers which allows them to write > custom logic to decide if they want to write out the session or not. (this > would still be a potential BC break for some people, but a better upgrade > path, but it would also cause introducing new features in a minor version, > which would cause for apps/libs to either depend on a minor version or > support both versions in their custom session handler). > 3. revert the write short circuit. (this would cause a small perf loss for most > users - to the same level as it was before 5.6 -, but it would eliminate the > BC break when migrating to 5.6, and it would allow us to take our time to > have time to properly figure out the introduction of this feature including > the interaction with the custom session handlers). > > I would vote for 3, Depending on the context, I'd vote for multiple of those options ... Short-term fix for 5.6 is obviously to revert the commit. I was vocal mostly because of principle at the time, but this issue is an example why. A long-term "fix" for 5.6 would be what I've done in userland recently - continue to call SessionHandler::write() at all times, but _inside of it_ call touch() instead of fwrite() if there's no new data. That way custom session handlers wouldn't be affected, but the default one would still provide a performance boost. This is of course if we do want to keep the feature (I do), but considering that it was voted in a slightly different form ... I'm just being egoistic with this suggestion. For PHP7 though, I definately want a redesign of the session APIs and it's on my TODO list for when I have some spare time to work on it. Cheers, Andrey.