Skip to content

Datatype caching causes device instances to leak outside blueapi context lifetimes. #1221

@rtuck99

Description

@rtuck99

The blueapi context system tests picked up device instances accumulating due to changes introduced in

Investigation identified that during creation of derived signals, the getter/setter functions of the base signals were passed to cached_get_type_hints(), as these are methods bound to the parent device instance, use of them as cache keys causes the device instances to leak until they are evicted from the cache.

(see discussion with @coretl in mx-bluesky PR for test fix DiamondLightSource/mx-bluesky#1642)

This can be remedied by not caching these entries.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run mx-bluesky system tests
  2. test_baton_handler_soak fails

Acceptance Criteria

  • mx-bluesky system tests pass and device instances no longer accumulate.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions