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
* Protect against stdout.txt not existing
It seems like it dropped the execution lock (maybe it threw an error) when executing The command apt-get -o DPkg::Lock::Timeout=180 upgrade -y dotnet-sdk-8.0 was forwarded to the master process to run.
It waited about 2 seconds then freed the server before it was done. It freed before it threw but free happens before throw, so it might have failed for some reason, then failed again since stdout.txt didn't exist because the process wasn't done running. then freed. When it freed, it was still going but then it allowed the sudo master process killer to run which caused this to fail later....
Still not sure why that'd happen, it might be if the locking was not implemented correctly.
* Fix lint
* Add timeout to the logging
* Make each sudo process instance get its own directory.
This will help prevent an existing process from colliding with another.
* Dont delay anymore since the chance of this is very low
this is basically like random int collision at this point, could probably remove.
* Fix lint
* Throw an error if stderr DNE
Co-authored-by: Copilot <[email protected]>
* Fix support matrix
* Dont echo env in linux
* Fix copilot change
* Fix lint
* Fix env var logging
* Fix env var logging
* Consider that EEXIST may be thrown instead of EADDRINUSE with certain kernels
EACCESS as well. This may be something that will not resolve, though if some admin thing is blocking and holding the file, perhaps this is a good resolution. I never encountered this when trying different permissions on my demos but it seems that some people are.
* Remove extraneous check
* Use the old dir as a fallback if we cant create dirs and throw
* Lint
* Delete the directory
might as well do it in this PR
---------
Co-authored-by: Copilot <[email protected]>
error.message=error?.message+`\nFailed to create ${this.sudoProcessCommunicationDir}. Please check your permissions or install dotnet manually.`;
103
+
this.context?.eventStream.post(newSudoDirCreationFailed(`The command ${fullCommandString} failed, as no directory could be made: ${JSON.stringify(error)}`));
// @ts-expect-error We want to hold the lock and sometimes return a bool, sometimes a CommandExecutorResult. The bool will never be returned if runCommand is true, so this makes the compiler accept this (its bad ik).
@@ -128,14 +157,6 @@ Please install the .NET SDK manually by following https://learn.microsoft.com/en
128
157
return'0';
129
158
}
130
159
}
131
-
else
132
-
{
133
-
if(awaitthis.sudoProcIsLive(false,fullCommandString,1000))// If the sudo process was spawned by another instance of code, we do not want to have 2 at once but also do not waste a lot of time checking
134
-
// As it should not be in the middle of an operation which may cause it to take a while.
135
-
{
136
-
return'0';
137
-
}
138
-
}
139
160
140
161
// Launch the process under sudo
141
162
this.context?.eventStream.post(newCommandExecutionUserAskDialogueEvent(`Prompting user for command ${fullCommandString} under sudo.`));
this.context?.eventStream.post(newSudoProcAliveCheckEnd(`Finished Sudo Process Master: Is Alive? ${isLive}. ${newDate().toISOString()}
222
-
maxTimeoutTimeMs: ${maxTimeoutTimeMs} with lockTime ${waitForLockTimeMs} and responseTime ${waitForSudoResponseTimeMs}`));
243
+
waitForLockTimeMs: ${waitForLockTimeMs} with lockTime ${waitForLockTimeMs} and responseTime ${waitForSudoResponseTimeMs}`));
223
244
224
245
// The sudo process spawned by vscode does not exit unless it fails or times out after an hour. We can't await it as we need it to persist.
225
246
// If someone cancels the install, we store that error here since this gets awaited to prevent further code statement control flow from executing.
@@ -279,22 +300,24 @@ ${stderr}`));
279
300
this.context?.eventStream.post(newCommandProcessorExecutionBegin(`The command ${commandToExecuteString} was forwarded to the master process to run.`));
eventStream.post(newSudoDirCreationFailed(`The command ${this.sudoProcessCommunicationDir} failed to rm the sudo directory: ${JSON.stringify(error)}`));
0 commit comments