View Issue Details

IDProjectCategoryView StatusLast Update
0004311unrealircdpublic2014-08-24 18:48
Reportersyzop Assigned Totmcarthur  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.4-alpha1 
Fixed in Version3.4-alpha2 
Summary0004311: [3.4] Move TKL checking to loop again
Descriptionnenolod moved the "check all users against all TKL's" check to m_tkl (or one of the functions in that file). It is now being called for each and every *LINE that is added.
Previously it simply set a flag if any TKL was added and we checked for TKL's inside the ircd loop if that flag was set.

We really need to restore the original behavior. Not sure what he was thinking at that time......
TagsNo tags attached.
3rd party modules

Activities

tmcarthur

2014-06-02 08:05

reporter   ~0018160

I can handle this one - and yeah that logic is kind of ridiculous.

syzop

2014-06-02 19:36

administrator   ~0018165

Yeah. Say a server links in and adds 1000 *LINES. Previously this would mean that these 1000 *LINES are checked against all local users once if the burst was fast enough, or a number of times, like after 100, 200, 300, etc.. so 10 times (probably more realistic).

Then nenolod did this in m_tkl.c:
/* The TKL check is now run immediately, because there is not much value in postponing
 * the check. It just made check_pings() more complex than it should be. --nenolod
 */
check_tkls();

Say we have 1000 local users. With his change:
* when the first *LINE is added, all TKL's (say: 1) is checked against all 1000 users
* when the second *LINE is added, all TKL's (now 2) are checked against all 1000 users
...
* when the 1000th *LINE is added, all TKL's (now 1000) are checked against all 1000 users

So previously there were like 100+200+300..1000 checks times 1000 users = 5.5 million (+/-)
Now with his change there are 1+2+3+...1000 checks times 1000 users = 500.5 million

A fantastic improvement! .. :)

tmcarthur

2014-08-24 18:48

reporter   ~0018239

Kept it as a separate function but moved it to take aClient* as param and do necessary checks that way - and to return an int so we can short-circuit the rest of the process if someone gets banned :)

Issue History

Date Modified Username Field Change
2014-05-31 22:23 syzop New Issue
2014-06-02 08:04 tmcarthur Assigned To => tmcarthur
2014-06-02 08:04 tmcarthur Status new => assigned
2014-06-02 08:05 tmcarthur Note Added: 0018160
2014-06-02 19:36 syzop Note Added: 0018165
2014-08-24 18:48 tmcarthur Note Added: 0018239
2014-08-24 18:48 tmcarthur Status assigned => resolved
2014-08-24 18:48 tmcarthur Fixed in Version => 3.4-alpha2
2014-08-24 18:48 tmcarthur Resolution open => fixed