Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

opcache_invalidate is not safe under high concurrencies

未关闭
#134 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
laravel, php

调研方向

检查 src/ComponentFactory.php 第 35 行,并审阅链接的 FrankenPHP issue 和 reproducer,以了解在请求期间如何调用 opcache_invalidate。对 reproducer 进行压力测试,包括使用 PostgreSQL 或 MySQL 的情况,并验证在高并发下,产生的行为不再导致不安全的 opcache 重置或内存损坏。

由索引模型根据 Issue 内容生成。

描述

Volt Version

1.7.1

Laravel Version

12.10.2

PHP Version

8.4.7

Database Driver & Version

No response

Description

This issue is specifically about this line in Volt. It would be nice if it can be avoided in productive environments: https://github.com/livewire/volt/blob/0ab9d34c53f87444017270a2178250a19f3083ec/src/ComponentFactory.php#L35

This was first raised in the FrankenPHP Repo, where @robsontenorio noticed that when stress testing, the application would end up in a memory corruption after a while.

This happens due to opcache_invalidate() being called each request leading to a buildup in memory that eventually leads to an opcache_reset().

opcache_reset() is currently not really safe under concurrency (both in FPM and FrankenPHP, so I'd recommend avoiding an opcache_reset if possible in production environments.

Also when testing with the reproducer, I noticed that the path passed to opcache_invalidate was that of a Blade file (which makes it look unitended)

Steps To Reproduce

You can use the reproducer provided by @robsontenorio https://github.com/robsontenorio/paper.mary-ui.com/tree/franken-bug

It will take a while for the corruption to appear, using postgres/mysql instead of sqlite will make it happen faster.

主要语言
PHP
星标
423
派生
36
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

livewire/volt 的其他 Issue

查看 livewire/volt 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。