Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Class "X" not found due to coroutine context switching in autoload #5180

Merged
merged 12 commits into from
Nov 14, 2023

Conversation

Yurunsoft
Copy link
Member

@Yurunsoft Yurunsoft commented Nov 6, 2023

问题:

瞬间有多个协程 new 一个未被加载的类,如果 autoload 里有协程切换,就会报错 Class "X" not found

解决方案:

hook zend_autoload(),当多个协程 autoload 同一个类时,协程挂起等待。

参考:swow/swow@beffeb4

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8a2dfcc) 72.94% compared to head (5888e84) 72.92%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5180      +/-   ##
==========================================
- Coverage   72.94%   72.92%   -0.03%     
==========================================
  Files          69       69              
  Lines       14855    14855              
==========================================
- Hits        10836    10833       -3     
- Misses       4019     4022       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matyhtf matyhtf merged commit 6f1df03 into swoole:master Nov 14, 2023
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants