[wp-trac] [WordPress Trac] #60915: WP 6.5 - RecursiveDirectoryIterator causing E_WARNING errors in New Relic

WordPress Trac noreply at wordpress.org
Thu Apr 4 13:07:45 UTC 2024


#60915: WP 6.5 - RecursiveDirectoryIterator causing E_WARNING errors in New Relic
-----------------------------------------+------------------------------
 Reporter:  iCaleb                       |       Owner:  joemcgill
     Type:  defect (bug)                 |      Status:  reviewing
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  General                      |     Version:  6.5
 Severity:  trivial                      |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:  performance
-----------------------------------------+------------------------------
Changes (by joemcgill):

 * keywords:  has-patch => has-patch changes-requested
 * owner:  (none) => joemcgill
 * status:  new => reviewing


Comment:

 Thanks for the detailed report, @iCaleb. It's odd that New Relic is
 reporting these errors given that we've intentionally put this code inside
 a try/catch block. It seems like this could be related to
 [https://forum.newrelic.com/s/hubtopic/aAX8W0000008egMWAQ/php-handled-
 exceptions-reported-as-error-by-the-new-relic-php-agent this issue]
 reported in the NR forums.

 That said, I see how this could be annoying. Given that the removal of the
 file_exists check in [57215] was essentially a micro-optimization, it
 would be fine to revert that part of the change. I think using `is_dir` as
 @sean212 is suggesting in [https://github.com/WordPress/wordpress-
 develop/pull/6355 this PR] is better than the previous `file_exists`
 check. I've [https://github.com/WordPress/wordpress-
 develop/pull/6355#pullrequestreview-1979816765 left a suggestion here].
 Let me know what you both think.

 If New Relic fixes this issue, or we can identify why it's happening and
 avoid having these types of expected handled errors being reported, then
 it would be nice to be able to avoid these types of filesystem checks,
 when possible.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60915#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list