Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: McRouter leaks the client instance if it encounters errors, like config failure, SMC unavailability, etc. This has caused [some issues](https://fb.workplace.com/groups/604299349618684/permalink/27403334835955105/) for us over the past year. **This diff:** Moving the client instance to the aux thread, so it can be auto-destructed after its SR dependencies are released. With the [context](https://fb.workplace.com/groups/604299349618684/posts/27403334835955105/?comment_id=27406017052353550&reply_comment_id=27406822342273021) disylh shared, I was curious to see if this approach might work, and what might be the gaps we need to tackle. I followed the discussion on the [previous attempt](https://www.internalfb.com/diff/D44641566?dst_version_fbid=1590697228110996&transaction_fbid=143930055086555) where this was discussed. Iiuc, #1 is addressed now as we manually do the SR deps release before destruction. I didn't quite follow #2, and why clearing the event base would cause the deadlock (maybe it wouldn't anymore, since we destruct from a different thread). But curious to hear opinions! Reviewed By: disylh Differential Revision: D66252318 fbshipit-source-id: 498ea74ab78c6dc0e70b1471a0779551002e27ac
- Loading branch information