datalad / datalad-ria

Adds functionality for RIA stores to DataLad
http://datalad.org
Other
0 stars 1 forks source link

Patch to enable SSH-based remote command executor for windows clients #73

Closed mih closed 1 year ago

mih commented 1 year ago

This patch aims to fix a hanging Python sessions after the execution of an SSH remote command call with no particular stdin input.

Interpretation from #68

Without overriding stdin, the subprocess, i.e. ssh, and python share
the same file pointer. It seems that stdin is configured in a way that
unexpected by the interpreter and messes with python's way to read from
sys.stdin.

This patch passes an explicit b'' as stdin to the SSH client execution process to effectively achieve a separate fiel descriptor for that client process.

This patch should not interfere with the implementation of the sshrun command in datalad-core. It uses a dedicated not-None value for any execution. However, the compatibility and interference of this patch should be subject to a thorough investigation and widespread testing before this changeset is proposed for datalad-core.

Towards fixing #68

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 95.23% and project coverage change: -0.36% :warning:

Comparison is base (887bc23) 97.88% compared to head (7ed2c2e) 97.53%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #73 +/- ## ========================================== - Coverage 97.88% 97.53% -0.36% ========================================== Files 10 13 +3 Lines 142 162 +20 ========================================== + Hits 139 158 +19 - Misses 3 4 +1 ``` | [Files Changed](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | Coverage Δ | | |---|---|---| | [datalad\_ria/patches/ssh\_exec.py](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9yaWEvcGF0Y2hlcy9zc2hfZXhlYy5weQ==) | `93.75% <93.75%> (ø)` | | | [datalad\_ria/\_\_init\_\_.py](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9yaWEvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [datalad\_ria/patches/\_\_init\_\_.py](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9yaWEvcGF0Y2hlcy9fX2luaXRfXy5weQ==) | `100.00% <100.00%> (ø)` | | | [datalad\_ria/patches/enabled.py](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9yaWEvcGF0Y2hlcy9lbmFibGVkLnB5) | `100.00% <100.00%> (ø)` | | | [datalad\_ria/tests/test\_ssh\_connection.py](https://app.codecov.io/gh/datalad/datalad-ria/pull/73?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9yaWEvdGVzdHMvdGVzdF9zc2hfY29ubmVjdGlvbi5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.