• Nils Goroll's avatar
    vbp: Rework probe state management · ab21f4a2
    Nils Goroll authored
    Every time I looked at the probe code, my mind ended up twisted and confused. A
    probe could change the "enabled" state (tracking the temperature) and be removed
    at any time (unless the mtx is held), yet the code did not seem to reflect this.
    
    We un-twist my mind by completing the transition to probe states and adding a
    chain of two states for the case that a probe is controlled/deleted while its
    task is running:
    
    cooling: running probe disabled
    deleted: running probe removed (while cooling only)
    
    With this new scheme, we can now have (I think) a clean state diagram (see dot
    file):
    
    - a probe begins in the cold state
    - from cold, it can either get removed or scheduled via VBP_Control()
    - from scheduled, it can go back to cold (via VBP_Control()) or
      be picked up by vbp_thread() to change to running (aka task started)
    - once the task finishes, it normally goes back to scheduled,
      but in the meantime it could have changed to cooling or deleted,
      so vbp_task_comple() hadles these cases and either transitions to cold
      or deletes the probe
    - if the task can not be scheduled, the same handling happens
    
    We now also remove running probes from the binheap to remove complexity.
    
    Fixes #4108 for good
    ab21f4a2
Name
Last commit
Last update
..
Makefile.am Loading commit data...
cache_backend_probe.dot Loading commit data...
cache_fetch.dot Loading commit data...
cache_fetch.svg Loading commit data...
cache_http1_fsm.dot Loading commit data...
cache_http1_fsm.svg Loading commit data...
cache_req_fsm.dot Loading commit data...
cache_req_fsm.svg Loading commit data...