Payback159/tenama

Should it be possible to configure shorter namespace lifetimes than the cleanup loop checks?

Opened this issue · 0 comments

Describe the bug

If the namespace lifetime is smaller than cleanupInterval in the tenama configuration, the namespace may still exist longer than desired.

To Reproduce
Steps to reproduce the behavior:

  1. set cleanupInterval in the tenama configuration for example to 15m
  2. create namespace with a lifetime of 5m
  3. wait for 5m if the loop isn't random synced with the namespace lifetime the namespace will exist after 5m

Expected behavior
I would expect that the namespace will be cleared after it's configured lifetime.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

I think at the moment the problem exists because the cleanup logic is based on a timely based loop which is execute in a configureable time (in the example all 15m). Maybe we can implemented an api-watcher which get's notified when the lifetime of a namespace is reached and cleans it on a more event-based way.

Alternative we can implement that the namespace lifetime can't be smaller than the cleanupInterval but I think that would be not the best solution.