-
Notifications
You must be signed in to change notification settings - Fork 191
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
refactor: allow hot swapping the config #192
Conversation
We introduce shared listeners that allow us to keep an old config running while we set up a new config. This is done by keeping track of the usage of the listeners and only closing them when the last user is done with the shared listener.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to readjust some things. Happy to brainstorm more.
707bc35
to
80e5d49
Compare
Added a read and close channel to the virtual packet connection. |
18e407a
to
4730d74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new structure looks nicer. The main things now is the new virtual packet conn, which needs a redesign, and the RefCount can probably go away.
851ac28
to
8f9f1ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready for another look, @fortuna please take a look specifically at the packet conn handling. I ended up using a read and a response channel. I think this resolves the issue you pointed out, but I'm curious to hear what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just some small clean ups.
Also, is there a benchmark that exercises that code that we can check to make sure it's fine?
Instead of keeping track of a diff of ports to keep open, we introduce reusable listeners that can be hot-swapped by remaining open until the last user of the listener closes it.
This pulls out the listener changes from #182, which is focused on adding a new config format.