Skip to content
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

Promises are not resolved/rejected when connection is lost during operation #30

Open
jeffrson opened this issue Jul 1, 2019 · 2 comments

Comments

@jeffrson
Copy link
Contributor

jeffrson commented Jul 1, 2019

This may sound similar to #27, but it's not.

While the former hands off control to streams, there are more direct issues with commands like "rmdir" (just an example which happened to me...).

I have written an SFTP server with NodeJs/SSH2. I use SSH2Promises to, say, remove a directory. Yes, it was a bug that the server crashed when I was trying to do that. But there are other circumstances which could lead to disconnection during operations. The problem here is, that the promise that's returned from sftp.rmdir(directory) is never resolved or rejected when this happens.

Now I could try to listen for 'ssh' events again and continue somehow (have another promise and use Promise.race) - but this would still keep the original promise pending for ever.

Any idea how to "cancel" the promise?

@jeffrson
Copy link
Contributor Author

jeffrson commented May 1, 2022

Looks like closing sftp connection in "ssh" disconnected event releases the promise by rejecting.

@jeffrson jeffrson closed this as completed May 1, 2022
@jeffrson
Copy link
Contributor Author

jeffrson commented May 2, 2022

Uh - no. Must 've been wrong test case.

Promise is not released unfortunately.

@jeffrson jeffrson reopened this May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant