Skip to content

Process manager warning: Placeholder state persisting for VirtualId(25) #2

@pannous

Description

@pannous

Description

During runtime, a warning is being triggered indicating that a PendingState::Placeholder is persisting when it should have been replaced with a valid state.

Warning message:

[src/procmgr.rs:284 WARN] State Id(25) was placeholder!

Root Cause Analysis

In recipes/core/base/source/bootstrap/src/procmgr.rs, the Placeholder variant is used as a temporary placeholder during state transitions:

let this_state = core::mem::replace(state, PendingState::Placeholder);

The placeholder should always be immediately replaced with a valid state. However, line 284 shows that sometimes a cancellation request encounters a Placeholder state, which suggests:

  1. A state transition didn't complete properly (the placeholder wasn't replaced)
  2. A cancellation is being processed before the state transition completes
  3. There's a race condition between state updates and cancellations

Location

  • File: recipes/core/base/source/bootstrap/src/procmgr.rs:284
  • Function: Cancellation handling logic
  • Related: Line 1672 where placeholder is created during state transitions

Expected Behavior

The Placeholder state should never be observed during normal operation. It should only exist momentarily during mem::replace operations.

Actual Behavior

VirtualId(25) is in a Placeholder state when a cancellation request is processed, triggering the warning.

Impact

  • May indicate incomplete state transitions
  • Could potentially lead to request handling failures
  • Suggests possible race conditions in process management

Suggested Investigation

  1. Add more detailed logging around state transitions (especially around line 1672)
  2. Check if there are concurrent operations on the same VirtualId
  3. Verify that all code paths properly replace the Placeholder with a valid state
  4. Consider using a more robust state transition mechanism that doesn't rely on temporary invalid states

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions