Skip to content

Commit

Permalink
Fix: Exec Process deadlock
Browse files Browse the repository at this point in the history
WaitForExit should have been called after all other methods are called on the process
  • Loading branch information
avin3sh committed Nov 18, 2023
1 parent 1ace761 commit f3f1f03
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,13 @@ public static ExecCredentialResponse ExecuteExternalCommand(ExternalExecution co

try
{
if (!process.WaitForExit((int)(ExecTimeout.TotalMilliseconds)))
var responseObject = KubernetesJson.Deserialize<ExecCredentialResponse>(process.StandardOutput.ReadToEnd());

if (!process.WaitForExit((int)ExecTimeout.TotalMilliseconds))
{
throw new KubeConfigException("external exec failed due to timeout");
}

var responseObject = KubernetesJson.Deserialize<ExecCredentialResponse>(process.StandardOutput.ReadToEnd());
if (responseObject == null || responseObject.ApiVersion != config.ApiVersion)
{
throw new KubeConfigException(
Expand Down

0 comments on commit f3f1f03

Please sign in to comment.