Skip to content

RunConfig is read from disk multiple times per workload during reconciliation #4456

Description

@JAORMX

Problem

During a single reconciliation cycle (e.g., thv list or thv status), the fileStatusManager reads the same RunConfig file from disk multiple times per workload via runConfigStore.GetReader():

  1. isRemoteWorkload() — reads remote_url field
  2. isOwnedByActiveRuntime() — reads runtime_name field
  3. migrateRuntimeName() — reads all fields (for write-back on legacy workloads)

Each call opens the file, parses JSON, extracts one or two fields, then closes. For a user with N workloads, thv list performs up to 3N file reads where N would suffice.

References

  • isRemoteWorkload: pkg/workloads/statuses/file_status.go (~line 169)
  • isOwnedByActiveRuntime: pkg/workloads/statuses/file_status.go (~line 82)
  • migrateRuntimeName: pkg/workloads/statuses/file_status.go (~line 114)
  • Related import cycle TODO: pkg/workloads/statuses/file_status.go (~line 73)

Introduced by #4434.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggoPull requests that update go codeperformance

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions