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

fix: add timeout for command execution #3980

Merged
merged 1 commit into from Sep 25, 2023

Conversation

fengxsong
Copy link
Collaborator

@fengxsong fengxsong commented Sep 25, 2023

🤖 Generated by Copilot at 6b46101

Summary

🕒🛠️🚀

Added command execution timeout feature to pkg/ssh package and improved the timeout and error handling of SSH commands. This feature allows the user to control the duration of command execution and avoid blocking or hanging issues.

No more waiting for the ssh command
We control the timeout with our hand
If the connection fails or the execution stalls
We unleash the fury of context.WithCancel

Walkthrough

  • Add command execution timeout feature to ssh package (link, link, link)
  • Modify CmdAsync function in pkg/exec/exec.go to use context with timeout (link)
  • Clarify flag description for timeout in pkg/ssh/option.go (link)
  • Improve error handling in CmdAsyncWithContext function in pkg/ssh/sshcmd.go (link)

@sealos-ci-robot
Copy link
Member

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 967
✅ Successful 400
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 566
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@cuisongliu cuisongliu added this to the v4.4 milestone Sep 25, 2023
@cuisongliu cuisongliu merged commit 5b3b444 into labring:main Sep 25, 2023
92 checks passed
@sealos-ci-robot
Copy link
Member

/cherry-pick release-v4.4

@sealos-ci-robot
Copy link
Member

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/labring/sealos/actions/runs/6297164110

cuisongliu pushed a commit that referenced this pull request Sep 25, 2023
Co-authored-by: fengxsong <fengxsong@outlook.com>
bxy4543 pushed a commit to bxy4543/sealos that referenced this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants