-
Notifications
You must be signed in to change notification settings - Fork 37
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
fix(channels): readd clearing and fix auto start #297
Conversation
DEV-2206 Add back clearing of channels
When extracting the channels in another package, the feature of removing the channels after a certain time that they are not used in the lru was removed so add it back |
Note: It's possible that a channel gets cleared up while having messages queued to be sent out. In that case we should wait before clearing the channel, otherwise there will be very rare and very hard to debug misses when sending out messages. |
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.
Nice work as usual!!
Here are some missing parts:
- Autostart (botpress -> messaging) missing.
- Autostart callback needs to handle the case where a conduit is errored and does not start it.
This PR fixes some problems that were introduced by #270
Notably the notion of keeping a lru of most used channels, and clearing the ones that aren't used was removed. Since this is a potential memory leak (although you'd really need to have a lot of channels), this PR fixes that. It also fixes channels auto starting and bypassing the normal start for a channels. So for example a channel could start without producing a health event.
Since these changes concerned the instance service, I took the time to refactor it into multiple sub services since the code was getting messy
Closes DEV-2206
Closes DEV-2212