-
-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SshCommand.Execute deadlock #1506
Comments
Hmm, could be. Are you running in a GUI / ASP.NET / non-console environment? Can you reproduce the problem consistently? If yes, does making this tweak to the library make a difference? diff --git a/src/Renci.SshNet/SshCommand.cs b/src/Renci.SshNet/SshCommand.cs
index 6bfd5742..96188e4c 100644
--- a/src/Renci.SshNet/SshCommand.cs
+++ b/src/Renci.SshNet/SshCommand.cs
@@ -279,7 +279,7 @@ public Task ExecuteAsync(CancellationToken cancellationToken = default)
_cts = null;
_cancellationRequested = false;
- _tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
+ _tcs = new TaskCompletionSource<object>(TaskCreationOptions.None);
_userToken = cancellationToken;
_channel = _session.CreateChannelSession(); |
Hello @Rob-Hague |
Probably the issue is something else, i got a lock also with the older version : Probably more similar to : #462 |
In that case I'm not sure if there is something actionable here. I think my prior comment about |
At the moment i had to put the ssh command execution on a dedicated thread and add a watchdog to kill if not completed after some timeout. |
Hi,
i'm trying latest release 2024.1.0 and i think i found an issue with the api, there is a deadlock in the Renci.SshNet.SshCommand.Execute()
is it due the sync over async antipattern ?
Probably makes sense to do a fully async api to avoid the issue ?
The text was updated successfully, but these errors were encountered: