RunConfig is read from disk multiple times per workload during reconciliation
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
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():
isRemoteWorkload()— readsremote_urlfieldisOwnedByActiveRuntime()— readsruntime_namefieldmigrateRuntimeName()— 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/workloads/statuses/file_status.go, reading isOwnedByActiveRuntime(), migrateRuntimeName(), and isRemoteWorkload(), then trace the reconciliation paths used by thv list and thv status. Consolidate the per-workload RunConfig access while preserving the existing status and migration behavior; done means one disk read per workload instead of repeated reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100