-
Notifications
You must be signed in to change notification settings - Fork 645
Add timeouts for every process (except the ones that run in server mode) spawned by the extension #2348
Comments
The execFile method accepts a timeout parameter in milliseconds, time after which the child process will be sent a SIGTERM signal This fallback is really needed, as guru is still unusable on my workspace since it kills my mac with a couple dozen processes, but which is an acceptable default value? also, it would need to be either:
I guess you're talking about the debugger and the language server. Is there any other case I'm missing? |
There are 3 types of operations
The first 2 types should have shorter timeouts, and the 3rd one can afford to have longer timeout. VS Code has a timeout for the formatOnSave feature ( For us, I can think of a single setting say
|
This timeout should send a CancellationToken to the extension so there isn't anything to do on our side right?
I was thinking on implementing an execFile wrapper in utils that handles the configuration retrieval and timeout parameter according to an enum parameter with these values |
Yes.
You would have to maintain a mapping between the enum value and the name used in the configuration. Most of our files already access the configuration object, so doing the configuration retrieval in the the wrapper doesnt give much benefits. |
So, these are all the execFile calls we currently do (excluding the debug adapter):
If we had to classify them all according to use case but at the same time differentiating against execution times we would have something like this: {
"go.operationTimeout": {
"buildOnSave": 2000, //go build
"buildOnCommand": 2000, //go build
"runtimeDefault": 2000, //go xxx (goRuntimePath)
"executeOnSave": 2000,
"executeOnCommand": 2000,
"executeOnType": 2000 //completions, live-errors
}
} This may be a bit verbose for a configuration though, so tell me what you think |
The verbosity is fine
|
In terms of plausible execution times the tools version, env, list and doc
might appear to be in a lower tier; build, test, get and install can be
long running in comparison with the former
…On Wed, Mar 6, 2019, 03:39 Ramya Rao ***@***.***> wrote:
The verbosity is fine
- I would replace "execute" with "operation" in executeOnSave,
executeOnCommand and executeOnType
- runTimeDefault will need some more thought. We use this for go
version, go env, go list, go doc, go vet, go build, go test, go get, go
install. They all cannot fall under the same bucket and use the same
timeout.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2348 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGCH_zrQSWNf96xKisQdtmj_l8uR6rYUks5vT2KFgaJpZM4bOS0a>
.
|
Some operations that use |
Then we can move it to the group of long running tasks. Results may be cached but any initial run will do it in full extent, so I prefer to be lax rather than conservative about these thresholds. I usually find myself doing a lot of GOCACHE=off calls to go tools because from time to time I have to switch across go versions in our projects (I use a fork of gvm for that matter) |
Closing in favor of golang/vscode-go#91 now that we are moving repos. The PR will be the place of further discussion here. See We are moving section in our readme for more details. Thanks for all your support @lggomez! |
This extension depends on a host Go tools to provide various features.
As seen in #2084, any of these tools can get into a non responsive state or run for way too long. To avoid bad user experience we should apply a timeout on such scenarios and kill the processes on timeout
The text was updated successfully, but these errors were encountered: