Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126164 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id E23C11A00BD for ; Sun, 22 Dec 2024 09:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1734860370; bh=bz5jswqYmOUlychNGFsMc0Z+CRwuSOJ083Cc1j5Nz+E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=X3ap4T4F1ge64+rEwKvDP4Hh4EUladCwDibzOxKTGOJGMoH6LJxFEWcZFTZ6CO4pk MZfCCYKMIvw6vKnldUr19JRmWEg1zIgKsOAvyfEeWA+8AmtWGc9ktUiVgRhzxNi2u4 KL7OaEZANN9uEwdvqcAsbG/M5owqHhzmCUiDotrj/6IFChGEum5m9Kl9AJsOc5qzjf xZvwa3PNimR6UMmKUDQXn5h5xtvB/fiSTF/JTFOu0uRszdQWPS6pP0nb4WMLEs3PCC Kf5UkwL4p9gjsqGgd0TxP2o5iYNq6G3LJyteDE3aFjIAy8uWIWxC1n5/884asIgSUy 0E4N3Kj1IR3Lw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1C23418007F for ; Sun, 22 Dec 2024 09:39:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 22 Dec 2024 09:39:29 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-71e2766994bso1685520a34.3 for ; Sun, 22 Dec 2024 01:42:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734860550; x=1735465350; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KmbPV/HL74XDxPfhHRdGnziv0e0fE50N3TW6B94PoOY=; b=OncpLbaer7euGEwkl/3cLZgGqa+LrHK9yU7upuHwkQGq9rPO0gtAahjBnz0LFWQS3m 5ZtusM8K0Z5LjevY6YSN1o39SZ2i8nLtTP1Oqz3++lHy09QZkmwXtiSHKspISAeyxAnI 4U2KPejQ9C8dAaYC1fnPxxMFb247SsgDKZc04MladInhDRjInIxxs7OxIOLJZLIE84vW qT7dXlhsiOzeDpElNTTDStsN2NeSNsW0scjOaxDNK2W63J0ZIf637YcprywCMz8gg7Mn vjeYOl/pDZ3LQ8thgnIGqdu7BbJ65EOGtlnoIkju/t/4g9OnL2+4+VYlwhV1DmE+MchG 0hgg== X-Gm-Message-State: AOJu0Ywz3I7x+alfHVQi68cU5ALeMIrscZiltdlVPgwZtBAf3A6llj6K N9k3omVOLr8jTD/vGn75IryNA6YPzUMQNhA2FwH9JCs0jkVCkQ5f9fZJYspeWcTkdPoC/9YLoHG Pjou0BubCiJyOnaJNYqilj4bweZY5+w== X-Gm-Gg: ASbGncusB/YEsNLxIVCkLgvFWs9LxjI5IL/LhtDlocQE0GZ9Hr+NkhKMeT+5ZIwUHv1 sH9gVzqm4dh2xWtaT9sQ2SaA94szzaDzsXM/d X-Google-Smtp-Source: AGHT+IG4dPwbsKnG4TW43d15hqWXe2QJTxaiNwq//euXCJ2ChTtJism77ZQRt/fM05KOmv/HlfBthpZK4K4kYKlmrdQ= X-Received: by 2002:a05:6870:5594:b0:29e:3345:74ff with SMTP id 586e51a60fabf-2a7fb1a75fbmr5244093fac.23.1734860550400; Sun, 22 Dec 2024 01:42:30 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <27531d9d-9bfe-4acc-b9ab-80b1017e3038@app.fastmail.com> In-Reply-To: Date: Sun, 22 Dec 2024 09:42:19 +0000 Message-ID: Subject: Re: [PHP-DEV] Discussion: Remove file statcache? To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000d772130629d8b22a" From: bukka@php.net (Jakub Zelenka) --000000000000d772130629d8b22a Content-Type: text/plain; charset="UTF-8" > I suppose a possible alternative would be to modify all file system >> mutation functions (file_put_contents(), touch(), etc.) to flush the cache, >> which for whatever reason doesn't happen now. That would be above my skill >> level, though, so someone else would need to do it. Also, I don't know if >> there's a good reason those functions don't clear the cache currently or if >> it was just an oversight. >> >> > As I said we could probably handle some stream cases more aggressively but > it won't resolve the problem completely. We still have things like > system("touch /file/path") which we cannot flush the stat cache for. And > it's not just shell access - there might be some 3rd party extensions that > operate on files or there might be other programs accessing files at the > same time. So there are many places which we just cannot control. > > Thinking about it, there might be a possibility to address it (at least on Linux) using fanotify. Not sure about other platforms but maybe there are some solutions to address it. Also it might get a bit complex and not sure how much the solution is viable. I guess we should first research and maybe PoC to which extend this can be actually fixed. I will try to prioritize it and look into it in the coming weeks. Regards Jakub --000000000000d772130629d8b22a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I suppose a possible alternative would be to modify all file system mutatio= n functions (file_put_contents(), touch(), etc.) to flush the cache, which = for whatever reason doesn't happen now.=C2=A0 That would be above my sk= ill level, though, so someone else would need to do it.=C2=A0 Also, I don&#= 39;t know if there's a good reason those functions don't clear the = cache currently or if it was just an oversight.

As I said we could probably handle some stream cases more aggr= essively but it won't resolve the problem completely. We still have thi= ngs like system("touch /file/path") which we cannot flush the sta= t cache for. And it's not just shell access - there might be some 3rd p= arty extensions that operate on files or there might be other programs acce= ssing files at the same time. So there are many places which we just cannot= control.

=C2=A0
Thinking about it, there might be a possibility to address it (at least o= n Linux) using fanotify. Not sure about other platforms but maybe there are= some solutions to address it. Also it might get a bit complex and not sure= how much the solution is viable.

I guess we shoul= d first research and maybe PoC to which extend this can be actually fixed. = I will try to prioritize it and look into it in the coming weeks.

Regards

Jakub
--000000000000d772130629d8b22a--