top-think / think-orm

Think ORM——the PHP Database&ORM Framework
Apache License 2.0
413 stars 171 forks source link

v3.0.15 在高并发环境下使用模型缓存查询报错 #583

Closed ChinaMoli closed 1 month ago

ChinaMoli commented 2 months ago

错误日志

[TypeError]                                                                            
think\db\PDOConnection::pdoQuery(): Return value must be of type array, null returned  

Exception trace:
 () at /www/vendor/topthink/think-orm/src/db/PDOConnection.php:727
 think\db\PDOConnection->pdoQuery() at /www/vendor/topthink/think-orm/src/db/PDOConnection.php:919
 think\db\PDOConnection->find() at /www/vendor/topthink/think-orm/src/db/BaseQuery.php:1361
 think\db\BaseQuery->find() at /www/find.php:13
 {closure}() at /www/find.php:15

复现代码

  1. 打开两个控制台 A 和 B
  2. 在控制台 A 执行 php find.php
  3. 随即在控制台 B 执行 php update.php

Gif 演示

PixPin_2024-07-09_14-11-37