Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] fix ErrorException in CacheWarmerAggregate#43501
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[HttpKernel] fix ErrorException in CacheWarmerAggregate#43501
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedOct 14, 2021
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
06edb66 toe623192Compare| { | ||
| $collectedLogs = []; | ||
| if ($collectDeprecations =$this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) { | ||
| $collectedLogs = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this should be reverted, the IDE is just missing a brain :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fair enough, will take care of that.
Reverting that is:p
derrabus left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good to me. Is it possible to write a test for that change?
Ahummeling commentedOct 28, 2021
Oh I hadn't looked into that actually. |
Ahummeling commentedOct 29, 2021
So@derrabus I am running into an issue here attempting to test this. The relevant codeblock is only executed when the constant |
nicolas-grekas commentedOct 29, 2021
I'm not sure this can be tested, because I suspect this might happen only in some race conditions. |
e623192 to2eaa19fCompareAhummeling commentedOct 29, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I am quite sure you can replicate it without race conditions by truncating the file to size 0 before warming cache |
nicolas-grekas commentedOct 29, 2021
Oh, can you figure out a test case then? |
Ahummeling commentedOct 29, 2021
Yeah give me a few minutes and I'll push my testcase |
Ahummeling commentedOct 29, 2021
So without the With the |
| publicfunctionwarmUp($cacheDir) | ||
| { | ||
| if ($collectDeprecations =$this->debug && !\defined('PHPUNIT_COMPOSER_INSTALL')) { | ||
| if ($collectDeprecations =$this->debug &&(!\defined('PHPUNIT_COMPOSER_INSTALL') ||file_exists(CacheWarmerAggregateTest::$emptyFile))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
please revert this.
I'm fine if we don't test, compared to adding it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes!
I commited it to show why I thought I couldn't test it, and hoped that maybe I overlooked something.
I will revert the last commit and it should be good to go
fadafdc to2eaa19fComparefabpot commentedOct 30, 2021
Thank you@Ahummeling. |
I ran into an
ErrorExceptionreloading after some changes. I suppose this triggered a cache warmup call. This didn't go as expected, because$previousLogs = unserialize(file_get_contents($this->deprecationLogsFilepath));set$previousLogstofalseinstead of the expected array. I think it makes sense to only callarray_mergeif$previousLogswas successfully instantiated as an array.My IDE also pointed out that
$collectedLogswas possible undefined, so moving its declaration outside of the if block resolved that.Stacktrace: