Limit BlueScreen agent argument dumps - #618
Conversation
* opened 3.0-dev * requires PHP 8.1 * uses PascalCase constants * removed bridge for Latte * Logger: added typehints * Logger: md5 replaced with xxHash * error.log changed to warning.log * bar: errors panel => warnings * readme: added link to Joomla integration (nette#583) Link to Joomla! integration. * used attribute Deprecated * Update readme.md Add link to Yii3 integration --------- Co-authored-by: David Grudl <david@grudl.com> Co-authored-by: n3t <n3t@n3t.cz>
1731e8d to
efbf873
Compare
|
Independent confirmation of this, from production: we hit the same defect and filed #620 before finding this PR — closing that one as a duplicate. Two things from our side that may help move this along, because the impact is worse than a large It is a fatal, not just a big file. One stack frame holding a list of domain objects exhausted a 128 MB PHP-FPM worker inside
With
One residual this PR does not cover, in case it is worth a second commit: Happy to test a build of this against the original reproducer if that helps. |
BlueScreen agent output currently dumps stack trace arguments without applying the same item and string limits that the HTML dump uses. In practice this can produce extremely large
.mdexception logs when a stack frame contains a large root array or object graph.A real case was a hydration frame with a large result. The MD file grew to ~100 MB because the agent dump expanded the whole argument list.
This change fixes that in two parts:
BlueScreen::getAgentDumper()now respectsmaxLengthandmaxItemsagent.phtmlare dumped with their argument name as the dumper key, so the existingDumper::ITEMSlimiting also applies to large root values