Revert "better shadowban propagation"

This reverts commit 129f335363.

If there exists a loop in alts, this sends a worker into an infinite
loop, thrashes the database, and eventually crashes the worker. This,
in practice, makes shadowbanning people with many alts impossible since
our alt linking algorithm almost explicitly creates cycles rather than
maintaining a tree.

To fix this, we need SQL that builds a set of all Users in the
connected Alt graph of a given user (likely using a recursive CTE)
and then bans them at once, rather than running a depth-first search
with maximum depth that doesn't remember previously visited nodes.

There is also potentially the chance that this isn't because of cycles
per se but rather because quintic polynomial behavior explodes quickly
even in the low-double-digits number of alts.
master
Snakes 2022-12-13 23:21:53 -05:00
parent e4c9472c92
commit cf5eff3f48
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 0 additions and 16 deletions

View File

@ -889,22 +889,6 @@ def shadowban(user_id, v):
g.db.add(user)
check_for_alts(user, False)
for u in user.alts_unique:
u.shadowbanned = v.id
g.db.add(u)
for u in u.alts_unique:
u.shadowbanned = v.id
g.db.add(u)
for u in u.alts_unique:
u.shadowbanned = v.id
g.db.add(u)
for u in u.alts_unique:
u.shadowbanned = v.id
g.db.add(u)
for u in u.alts_unique:
u.shadowbanned = v.id
g.db.add(u)
ma = ModAction(
kind="shadowban",
user_id=v.id,