-
Notifications
You must be signed in to change notification settings - Fork 177
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
trickle: Sweep idle channels on the server. #3296
Conversation
This is consistent with the usage of lphttp elsewhere and allows us to actually make changes to its fields (eg, trickle server)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3296 +/- ##
===================================================
- Coverage 34.19096% 34.14555% -0.04541%
===================================================
Files 139 139
Lines 36846 36895 +49
===================================================
Hits 12598 12598
- Misses 23529 23578 +49
Partials 719 719
Continue to review full report in Codecov by Sentry.
|
Holding off on merging this until we have keepalives to ensure control API liveness since messages there are intermittent and we don't want those to be swept up |
Once #3299 and livepeer/ai-worker#313 are in, I'll merge this one |
Eventually cleans up anything on the trickle server side in case we miss a cleanup somewhere.
This does imply that channels need to be active regularly, so for naturally intermittent channels like control or events we will have to send a keepalive via clients periodically. (keepalives will also be useful for keeping client connections alive.)
Default 5-minute idle timeout, with a 1-minute sweep interval (both configurable). This basically requires us to explicitly start the trickle server (in order to start sweeping), and the
Start()
function returns a cancel-type function in order to stop things, a'la context cancel.Also adds an explicit "channel create" endpoint to the trickle server (empty POST to
/channel-name
without an associated sequence number). Not used right now but it has come in handy while testing elsewhere, eg in python.Also includes this change to make the
startAIServer
take a*lphttp
so we aren't copying the entire struct every time we pass this in, and can make changes to its fields (eg, assigning the trickle server)