Skip to content
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

does the range plugin never release leases? #148

Open
ThisGuyCodes opened this issue Jan 1, 2022 · 2 comments
Open

does the range plugin never release leases? #148

ThisGuyCodes opened this issue Jan 1, 2022 · 2 comments

Comments

@ThisGuyCodes
Copy link

Just looking to check if I'm missing something. If it doesn't I'd look to contribute a plugin (or update the existing one) that does.

@Natolumin
Copy link
Member

I'm not exactly sure what you mean: is this about expired leases never being garbage-collected or about handling DHCPRELEASE messages ?
In either case I don't think it should be in a separate plugin so feel free to send a PR to update the existing plugin for either feature as you need:

Expired Leases

To the best of my knowledge it does not and never has garbage-collected expired leases.
I suppose I didn't put it in last time I updated it because I was hoping we'd merge a common layer for managing leases which would handle it (#111) but that didn't happen and is kinda stalled.
For that reason, I'd say don't go overboard and a very simple approach would be good enough for now since I still hope to get that lease storage interface in eventually,

DHCPRELEASE

For DHCPRELEASE messages - I don't believe we handle them anywhere, but there isn't really an architecture or a proposal to handle them across multiple plugins reasonably.
The range plugin doesn't even look at message types at the moment so adding a few branches/functions to handle the various message types differently would be a good start

@ThisGuyCodes
Copy link
Author

I was just talking about garbage collecting expired leases, appreciate the complete response!

In that case I may make a PR for something quite basic:

  • goroutine per lease with a context and a time.After
    • should be fine for a couple thousand leases
    • cancel old context on renewal, make new goroutine
  • ignore expires leases when reading in the file

Not planning to bother with GC on the file. Rewrites and atomicity (outside of appends) seems like something to save for BadgerDB or similar...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants