You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce IgnoreExistingState bool to job.Job{}, to indicate whether to ignore existing data/cache.
initialize - IgnoreExistingState: false
textDocument/didOpen - IgnoreExistingState: true - this is only necessary to account for an edge case where the user opens editor with unsaved files from previous session, we could potentially avoid it if we tracked ModTime or any kind of indicator allowing us to compare the file being opened with the one already indexed, effectively implementing this TODO
The job could return return an error, such as NotChangedError{Handle: document.DirHandle}, such that downstream jobs can decide based on that, whether to run.
LoadModuleMetadata - check MetaState field + NotChangedError
DecodeReferenceTargets - check NotChangedError
DecodeReferenceOrigins - check NotChangedError
DecodeVarsReferences - check NotChangedError
GetModuleDataFromRegistry - check NotChangedError
Implementation Notes
Regarding NotChangedError - some downstream jobs run after multiple different jobs, so we need to make sure that the upstream job actually returns NotChangedError if and only if all jobs detect no changes.
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Background
This is a different approach to addressing a performance bottleneck when we have duplicate jobs, as originally described in #989
Proposal
Remove deduplication logic from the scheduler:
terraform-ls/internal/state/jobs.go
Lines 61 to 75 in ca335f5
Introduce
IgnoreExistingState bool
tojob.Job{}
, to indicate whether to ignore existing data/cache.initialize
-IgnoreExistingState: false
textDocument/didOpen
-IgnoreExistingState: true
- this is only necessary to account for an edge case where the user opens editor with unsaved files from previous session, we could potentially avoid it if we trackedModTime
or any kind of indicator allowing us to compare the file being opened with the one already indexed, effectively implementing this TODOtextDocument/didChange
-IgnoreExistingState: true
workspace/didChangeWorkspaceFolders
-IgnoreExistingState: true
workspace/didChangeWatchedFiles
-IgnoreExistingState: true
The job could return return an error, such as
NotChangedError{Handle: document.DirHandle}
, such that downstream jobs can decide based on that, whether to run.GetTerraformVersion
- decoder: Pick core schema only based onrequired_version
constraint #993ObtainSchema
- terraform/module: Introduce new job to parse provider versions from lock file #992ParseModuleConfiguration
- checkModuleParsingState
ParseVariables
- checkVarsParsingState
ParseModuleManifest
- checkModManifestState
LoadModuleMetadata
- checkMetaState
field +NotChangedError
DecodeReferenceTargets
- checkNotChangedError
DecodeReferenceOrigins
- checkNotChangedError
DecodeVarsReferences
- checkNotChangedError
GetModuleDataFromRegistry
- checkNotChangedError
Implementation Notes
Regarding
NotChangedError
- some downstream jobs run after multiple different jobs, so we need to make sure that the upstream job actually returnsNotChangedError
if and only if all jobs detect no changes.The text was updated successfully, but these errors were encountered: