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
js.logger.Printf("JOBS: Dispatching next job %q: %q for %q", sJob.ID, sJob.Type, sJob.Dir)
returnsJob.ID, sJob.Job, nil
}
This is a reasonable design for most jobs, but #924 introduced a new job, which is scheduled for open files, primarily because it relies on up-to-date AST.
Running that job in the main indexer is rather undesirable side effect of the main indexer taking any jobs concerning open files. It's not desirable because unlike other jobs, this one has a higher probability of failing and/or taking longer to finish, potentially delaying other more important tasks.
Proposal
Introduce more 1st class job priorities, such that the priority can be set during scheduling, instead of implied based on the file/directory.
That way we could still schedule GetModuleDataFromRegistry when the concerning file is open, but run it with lower priority on the background without blocking e.g. parsing or reference collections.
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
Currently, jobs have implied priority based on whether files within the directory which the job affects
terraform-ls/internal/state/jobs.go
Lines 193 to 246 in 12cc996
This is a reasonable design for most jobs, but #924 introduced a new job, which is scheduled for open files, primarily because it relies on up-to-date AST.
Running that job in the main indexer is rather undesirable side effect of the main indexer taking any jobs concerning open files. It's not desirable because unlike other jobs, this one has a higher probability of failing and/or taking longer to finish, potentially delaying other more important tasks.
Proposal
Introduce more 1st class job priorities, such that the priority can be set during scheduling, instead of implied based on the file/directory.
That way we could still schedule
GetModuleDataFromRegistry
when the concerning file is open, but run it with lower priority on the background without blocking e.g. parsing or reference collections.Example log where the request to the Registry times out: https://gist.github.com/radeksimko/20bbb39273caf8d1c557f56bf755f827
The text was updated successfully, but these errors were encountered: