Remove the concept of update_state

Background

From profiling, we have seen that Element._update_state() is a known bottleneck in our codebase. It is a complex area of the code which is (somewhat confusingly) handling state changes and is called very often.

We should aim to reduce our calls to Element._update_state() or, preferably, remove the whole concept.

Task description

Now that !1344 (merged) has landed, we have introduced push-based element state handling within BuildStream, but we are still heavily relying on calls to Element._update_state() to monitor/control state change. For push-based state handling, we should be able to know when an element and its reverse dependencies have probably changed state.

I have opened this ticket to help track our removal of the concept of Element._update_state().

Rough outline of the tasks are below (note that this might be prone to change):

  • Push-based queues: !1344 (merged)
  • Notify reverse dependencies when an Element becomes cached: !1406 (merged)
  • Remove ready for runtime checks from Element._update_state()
  • Remove Element._update_state_recursively()
  • Remove high level Element._update_state()
  • Refactor workspace handling so that they don't require special cased state monitoring (!1612 (merged))

Related to #902 (closed)

Edited by Daniel Silverstone