-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP illumos port #12
base: master
Are you sure you want to change the base?
WIP illumos port #12
Conversation
cool! The other implementations have been able to limit complexity by loading the full routing table in the I need to think a little bit if the semantics here are going to trip people up downstream: other implementations expect the object returned from For |
Thanks for the quick response!
Ahh. rtr := &router{}
rtr.ifaces = make(map[int]net.Interface)
rtr.addrs = make(map[int]ipAddrs) ) I'm going to look into this more later since I imagine that will provide the most consistent behavior for the expectations of this package.
Neat. That makes sense.
The runtime should be able to set a finalizer that handles this implicitly, so that the socket is closed and the message loop is canceled when all reference to the pkg router fall out of scope, but I didn't implement that correctly here/yet. Another alternative is to give each instance returned from |
TODO:
|
switch from using a single persistent connection to using a socket per-request. Mainly to prevent inspecting messages that have no relevance to our process when there are no active requests. And to prevent wasted memory/processing maintaining our own message queue. *hasty re-write, but it seems much better no real benchmarks, but running on 2 systems for 48 hours shows no errors (excluding "no-route" errors), ~2% cpu reduction, and a faster ipfs bootstrap.
I needed this to bring ipfs from
0.5.0-dev-fc8307fe6
up to the current master.This patch constructs (and shares) a BSD
route
socket (https://illumos.org/man/7P/route). Relaying requests/responses between go-netroute and the routing system.I've been running this for a few days now without any issues but there's still things to do
Specifically:
LittleEndian
references to anativeEndian
patternRouteWithSrc
and how this translates into theroute
protocoldecodeGetMessage
and the note aboveparseIP
)New
fall out of scope; right now it's a singleton in the pkg scope that stays open after the first call toNew
If anyone ends up looking this over now though I'd appreciate input on it.
I can run whatever tests and explain anything ambiguous if need be.
Otherwise I'm just going to push updates as they happen and flag someone for review eventually (when I'm more confident everything is working as expected).
Edit:
Footage of it alive for what it's worth: https://www.youtube.com/watch?v=Ye18nFYPyFc