Using `SessionHandler` doesn't always close session file
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
session_set_save_handler(new \SessionHandler, true);
session_start([
'save_path' => __DIR__,
]);
$_SESSION['test'] = function () {};
If you make a request to this you'll see a fatal error due to the serialization failing, if you try and make another request the file is still locked and the request hangs waiting for the lock to be released. Removing the session_set_save_handler() is sufficient to fix the problem. From what I can tell ps_close_user is called but it never appears to make the call to SessionHandler::close().
I've managed to replicate this behaviour on FPM (ZTS and NTS) and CLI server.
I've written a test: 88f32f48e2b6e7fd3554aef8d255f88d02a4e8db
PHP Version
8.3.11 and 8.3.13-dev
Operating System
Debian/Ubuntu
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
commit 88f32f48e2b6e7fd3554aef8d255f88d02a4e8db で再現とテストを開始し、次にセッション実装内の ps_close_user と SessionHandler::close() コールバックを追跡します。FPM または CLI server でこのケースを実行します。シリアライズに失敗するリクエストによってセッションファイルがロックされたままにならず、リグレッションテストがパスすれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100