inmanta / inmanta-core

Inmanta is an automation and orchestration tool
https://inmanta.com
Apache License 2.0
27 stars 7 forks source link

Fix agent cache #7696

Closed wouterdb closed 3 weeks ago

wouterdb commented 4 months ago

Problem

  1. The agent cache is now version based, this is complicated for end-users and becomes difficult in the new agent design
  2. Time based expiry is broken: https://github.com/inmanta/inmanta-core/issues/833

Proposed solution

  1. we keep version open for a fixed time X (e.g. 1 minute after last use ended)
  2. we generate a 'tick' to the cache regularly (e.g. 1s) to make it run finalizes), on a threadpool (taking care not to race actual usage.
sanderr commented 3 months ago

Discussed in planning meeting. Main difficulty that needs to be addressed: discarding an entry from the cache means calling a custom finalizer, which is not async, therefore has to be run on a thread. It must only be called when the agent is not actively using the thing cached. Might be easiest to extend this to "when the agent is not doing anything at all".

sanderr commented 1 month ago

See status on Slack