dragonfly
dragonfly copied to clipboard
fix(acl): skip http and add check on connection traversals
Fixes a bug that was reported in Discord.
When there is an update to an ACL user, the changes are propagated by traversing all the connections on each thread and calling SendAsync with an ACL update message pushed at the front of the queue. This internally activates the dispatch_fb_
.
Unfortunately, traversals on HTTP connections are causing numerous issues:
- SendAsync is problematic because for example it accesses
stats_
which uninitialized for that flow - We don't Join the dispatch_fb_ fiber on HTTP flow
All in all, I skip Http connections all together since they are not really part of ACL's atm. Furthermore, I noticed that in some HTTP connections the cc_
was nullptr (which I think it happens during shudown) and for that I added a sanity check that it's not nullpt (and therefore we won't crash by triggering DCHECK or UB on release)
@kostasrim thank you very much o/