Caching in get_worker_user() looks like premature optimisation

Bug #1357686 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Low
Gavin Panella

Bug Description

It appears to be trying to eliminate multiple calls to User.get_or_create(). However, get_worker_user() is only used when creating new NodeGroup objects, an infrequent operation.

The problem is that it introduces a lot of complexity. A cache backend must be configured in maas.settings, and there's code in several places in the test suite to clear the cache. There's even a clearcache command that actually does nothing because the cache backend we have configured is in-memory only.

I suggest we remove the cache.

Tags: tech-debt

Related branches

Gavin Panella (allenap)
Changed in maas:
assignee: nobody → Gavin Panella (allenap)
status: Triaged → In Progress
Raphaël Badin (rvb)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: none → 1.6.1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.