As noted in a code comment:
// @ToDo this is an amount between 1 and AbuseFilterProfileActionsCap, which means that the // reliability of this number may strongly vary. We should instead use a fixed one.
As noted in a code comment:
// @ToDo this is an amount between 1 and AbuseFilterProfileActionsCap, which means that the // reliability of this number may strongly vary. We should instead use a fixed one.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Use independent stats for emergency disable | mediawiki/extensions/AbuseFilter | master | +369 -64 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Restricted Task | |||||
Open | None | T302151 Emergency disable improvements | |||
Resolved | Daimona | T200036 Filters shown as throttled on Special:AbuseFilter even without throttled action | |||
Open | None | T183099 Provide a button for quickly reactivating filters | |||
Open | None | T210151 Emergency disable action count may be too low | |||
Resolved | matej_suchanek | T264629 Use independent stats for emergency disable |
Possible implementation:
When a filter is modified (FilterStore)
When processing filter hits (FilterRunner)
In EmergencyWatcher
Note that changing the TTL in the config will not result in existing keys being updated (which shouldn't be a big deal after all).
Overall, I think this should be quite simple. The main question is how to distribute this code. In particular, whether each component (esp. FilterStore and FilterRunner) should create/update the keys on its own, or whether there should be a central service for doing this (used by EmergencyWatcher as well). I think even with the first approach, some sort of "centralized knowledge" is necessary (e.g. for building the key), so we might as well just go with the second option.
When I started working on this, I realized the following. Filter updates are much less common than filter runs (which happen in real time). So the cache will usually contain only a few entries if any. If we attempted to update the key for every filter after every action, it would be a no-op in 95-99%. Therefore, we should also have a cache entry which tells for which filters it makes sense to update the cache entry (probably one key for each filter group). @Daimona What do you think?
Change 663190 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[mediawiki/extensions/AbuseFilter@master] Use independent stats for emergency disable
Change 663190 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Use independent stats for emergency disable