aodn/python-aodncore

The LazyConfigManager properties should not be mutable

Closed this issue · 0 comments

A follow-up to #67.

The LazyConfigManager properties are generally "dict" types, which makes it too easy to get a reference to a value and accidentally modify it. This is a big problem because the way the tasks are set up currently, the CONFIG object is created once and then used repeatedly by unrelated task executions, which means accidentally modifying it corrupts it for all subsequent task executions, e.g.

  1. file A arrives and is handled. The handler instance inadvertently modifies the config.
  2. file B arrives and is handled. The config was corrupted by the file A handler, and this further corrupts it
  3. file C arrives and the handler reuses the corrupt config (and probably corrupts it more!)