otp icon indicating copy to clipboard operation
otp copied to clipboard

Allow channel handler to control adjust_window message sending

Open yarisx opened this issue 1 year ago • 10 comments

The channel handler callback module can implement the get_adjust/0 function returning either 'immediate' or 'delayed' values. In the latter case the channel handler module is responsible for invoking ssh_connection:adjust_window/3 to send ssh_msg_adjust_window to the peer.

yarisx avatar Sep 03 '24 14:09 yarisx

CT Test Results

    2 files     29 suites   20m 55s ⏱️   467 tests   463 ✅  4 💤 0 ❌ 1 672 runs  1 648 ✅ 24 💤 0 ❌

Results for commit fb2d5d93.

:recycle: This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

github-actions[bot] avatar Sep 03 '24 14:09 github-actions[bot]

you can ignore "unexpected event found" errors in ssh test results at this stage, they're probably unrelated.

u3s avatar Sep 03 '24 14:09 u3s

Rebased to the latest master, hope that makes test failures go away.

yarisx avatar Sep 13 '24 05:09 yarisx

sorry for delay.

please convert draft into PR.

I think this is a wanted feature but we need to discuss some details:

  • naming: maybe auto and manual return values + window_handling_mode instead of get_adjust ?
  • I would like it be more self documenting ... maybe you have a better idea?

u3s avatar Oct 23 '24 07:10 u3s

I've changed the implementation because the initial code did not cover the case when clients do not utilize ssh_client_channel behaviour. Now any channel handler can set window handling mode using the new exported ssh_connection_handler:set_window_handling_mode/3. Also created a couple of tests to check that the code works, hopefully - as intended.

yarisx avatar Nov 22 '24 12:11 yarisx

  • this PR is affected by PR-9309
  • this PR still looks interesting but maybe we could re-discuss how it should look like - as functionality triggering it (PR-8345) is reverted.
  • I'm leaning towards having this logic nested in ssh_client_channel behavior, and leaving ssh_connection simple - I think this was initial intention behind modules in ssh application
  • what do you think about it?

u3s avatar Jan 30 '25 08:01 u3s

On one hand I agree that it would be better to keep the code clean and simple. On the other hand if this functionality is limited to the ssh_client_channel behaviour then any client that does not implement the behaviour cannot enjoy this kind of flow control. Also if I read the code correctly modules like ssh_cli, ssh_shell, ssh_sftpd also can't have this functionality without patching each module, because they implement ssh_server_channel behaviour which does not have any common code for handling ssh messages (which ssh_client_channel has). But then again if there was no demand for the feature up until now, nobody will get hurt by any implementation.

yarisx avatar Feb 19 '25 15:02 yarisx

I've pushed the changes to restore window-adjusting functionality to ssh_client_channel, is anything more expected from me?

yarisx avatar Feb 27 '25 07:02 yarisx

@IngelaAndin @u3s I see that the PR has the "stalled" label, probably have missed something. Could you please comment on what is expected from my side?

yarisx avatar Mar 20 '25 16:03 yarisx

@yarisx No waiting label means that you need to do something, stalled label means that we are swamped with other work and have problems prioritizing this at the moment , but please be patient because we are interested.

IngelaAndin avatar Mar 20 '25 16:03 IngelaAndin