Page MenuHomePhabricator

Make profiling count actions only once
Closed, ResolvedPublic


Yesterday I decided to examine this 3 years old commit, manually rebasing it to eventually put it under review and merge it in the future. After the rebase I started testing it and found a weird behaviour: a single action (e.g. an edit) was counted twice everywhere. So, both in Special:AbuseFilter and in Special:AbuseFilter/filterID the numbers in Of the last xx actions, this filter has matched yy were increased by 2 for every action. I started to debug this and determined that this happen due to stash edits: when you first start editing a page, filters are checked and (if they match) the internal counter is increased. Then, when you save the edit this check is performed again and you end up with a double increase. Sometimes, the increase is even of 3. Before even trying to fix it, I uploaded the master to spot differences. With big surprise, this (almost) already happens! In single filter's page, the xx increase is by 2, the yy by 1, so this also breaks relative statistics. I didn't test anymore, but this needs to be fixed since it produces wrong reports.

Event Timeline

Daimona triaged this task as High priority.Mar 29 2018, 3:06 PM
Daimona moved this task from Backlog to Internal bugs on the AbuseFilter board.

Note that this produces also other problems, see e.g. T176291#3667054. Maybe we should think about a robust long-term solution.

Change 422953 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Record stats only when the action is executed

This only needed some more checks, while a solution for the other task should actually be treated separately.

Change 422953 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Record stats only when the action is executed