FLU1 Factorization 1/N: Introduce ranch and factor out socket handling process #46
Loading…
Reference in a new issue
No description provided.
Delete branch "ss/flu1-factorization1-ranch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR introduces Ranch as network transport abstraction and adds socket handling
processes ("protocol handler" in Ranch's terminology), as the first round of FLU1 factorization.
TODO for later effort: Remove machi_listener_sup if possible
Not directly related commits are included in this PR:
machi_file_proxy_test
@shino This looks great so far! Nice work!
Ready for review, I hope 🔨
Planning to look at this tomorrow.
Preliminary +1 from me, yay.
Rebased on current master and force-pushed.
The only confirmed test failure was the known doublewrite problem.
I did see this message scroll by but I'm not sure if its important:
I'm a little concerned the try/after block might be masking a test failure we should care about.
Otherwise, this is suuuuuper cool. 🍰
Rebased and force pushed again.
I saw the line once in a while in
machi_flu1_test
... but not sure why.Identified. Race between
machi_flu1
andmachi_flu1_net_server
at cleanup phase,if
machi_flu1
dies first, ets table has gone and net server process getsbadarg
.I just added a comment at
eef00e4
.Hmm, yes, if that table disappears because the FLU proc has exited (clean shutdown or crash), the 'badarg' is good behavior in that it causes the net server proc to crash and so is "safe" from a Machi operation perspective. That probably also closes the TCP connection without a reply, which isn't very polite, but better than sending nonsense?
👍
@shino great work! Thank you for digging in on that race condition.
Thanks for review & valuable comments! > Scott & Mark