dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

fix(acl): skip http and add check on connection traversals

Open kostasrim opened this issue 10 months ago • 1 comments

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:

  1. SendAsync is problematic because for example it accesses stats_ which uninitialized for that flow
  2. 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 avatar Apr 10 '24 15:04 kostasrim

@kostasrim thank you very much o/

fafg avatar Apr 10 '24 18:04 fafg