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: GreetingModule sometimes occurs a timeout error #1371

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

24sama
Copy link
Collaborator

@24sama 24sama commented Jul 10, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

  • Fix: GreetingModule sometimes occurs a timeout error.
    For now, the timeout value of the GreetingModule will be calculated by adding up the timeout values of all hosts
  • Print human-readable task timeout error message.

Which issue(s) this PR fixes:

Fixes #1288

Special notes for reviewers:

Does this PR introduced a user-facing change?


Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 10, 2022
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 24sama

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 10, 2022
@24sama 24sama mentioned this pull request Jul 10, 2022
@Nello-Angelo
Copy link

Nello-Angelo commented Jul 10, 2022

    hello := &task.RemoteTask{
            Name:     "Greetings",
            Desc:     "Greetings",
            Hosts:    h.Runtime.GetAllHosts(),
            Action:   new(GreetingsTask),
            Parallel: true,
            Timeout:  800 * time.Second,
    }

I just changed the option from Timeout: 30 * time.Second, to Timeout: 800 * time.Second, in kubekey/pkg/bootstrap/precheck/module.go (but you may set any time)

@24sama
Copy link
Collaborator Author

24sama commented Jul 11, 2022

I just changed the option from Timeout: 30 * time.Second, to Timeout: 800 * time.Second, in kubekey/pkg/bootstrap/precheck/module.go (but you may set any time)

This is also a hardcode and maybe it doesn't work when the number of hosts is very large (100 hosts?).

This PR will automatically increase the imeout value of this task according to the number of hosts.
For example:

hosts:
  - {name: node1, address: 172.16.0.2, internalAddress: 172.16.0.2, port: 8022, user: ubuntu, password: "Qcloud@123"} 
  - {name: node2, address: 172.16.0.3, internalAddress: 172.16.0.3, password: "Qcloud@123"}
  - {name: node3, address: 172.16.0.4, internalAddress: 172.16.0.4, password: "Qcloud@123"}

The task timeout will be 30s cause the default host's timeout value is 10s.

- {name: node1, address: 172.16.0.2, internalAddress: 172.16.0.2, port: 8022, user: ubuntu, password: "Qcloud@123", timeout: 30} 
  - {name: node2, address: 172.16.0.3, internalAddress: 172.16.0.3, password: "Qcloud@123", timeout: 30}
  - {name: node3, address: 172.16.0.4, internalAddress: 172.16.0.4, password: "Qcloud@123", timeout: 30}

The task timeout will be 90s.

- {name: node1, address: 172.16.0.2, internalAddress: 172.16.0.2, port: 8022, user: ubuntu, password: "Qcloud@123", timeout: 30} 
  - {name: node2, address: 172.16.0.3, internalAddress: 172.16.0.3, password: "Qcloud@123", timeout: 60}
  - {name: node3, address: 172.16.0.4, internalAddress: 172.16.0.4, password: "Qcloud@123", timeout: 30}
  - {name: node3, address: 172.16.0.4, internalAddress: 172.16.0.4, password: "Qcloud@123", timeout: 10}

The task timeout will be 130s (30+60+30+10).

Signed-off-by: 24sama <jacksama@foxmail.com>
@pixiake
Copy link
Collaborator

pixiake commented Jul 15, 2022

/lgtm

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2022
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 849d5f213b0aa7e8d5e9c552a020d43da4022ab5

@ks-ci-bot ks-ci-bot merged commit 7f7971a into kubesphere:master Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

timeout failed
4 participants