Repository navigation
IMP Ignore block cache lock pairs in query findings - #72
Conversation
GET_LOCK and RELEASE_LOCK pairs from LockGuardedCacheLoader repeat by design. QueryAnalyzer now skips them by SQL shape, so n_plus_one, repeated and repeat_count ignore them. They stay in the Queries tab.
|
Review at 7bc1d76: PASS All 5 checks (PHP 8.2 to 8.5, JS) pass at this head, no pending. Skip scope: Tests cover both directions: 20 lock pairs give no finding, and a real repeated SELECT beside lock pairs is still flagged. Gating (not part of this diff, no change needed here): the analysis runs only on payload build, which happens after the request was allowed, so this change adds no cost when the bar is off. The recording hooks themselves check |
Magento's
LockGuardedCacheLoader(db lock provider) issuesSELECT GET_LOCK(?, ?)andSELECT RELEASE_LOCK(?)for every uncached block. On a cold category page that firedquery.n_plus_one("ran 20 times", call site resolves to LoggerProxy).QueryAnalyzer::analyze()now skips these by SQL shape, soquery.n_plus_one,query.repeatedandrepeat_countignore them. The queries stay listed in the Queries tab.Tests: lock pairs produce no findings; a real repeated SELECT beside lock pairs is still flagged.