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

Fixes #24548 - make SSH timeout configurable #5926

Merged
merged 4 commits into from
Aug 13, 2018

Conversation

ianballou
Copy link
Contributor

I found that I needed to increase this value when SSH provisioning a very slow machine. Making this configurable could help others who have the same problem.

@theforeman-bot
Copy link
Member

Do not merge! This patch has not been tested yet.

Can an existing organization member please verify this patch?

2 similar comments
@theforeman-bot
Copy link
Member

Do not merge! This patch has not been tested yet.

Can an existing organization member please verify this patch?

@theforeman-bot
Copy link
Member

Do not merge! This patch has not been tested yet.

Can an existing organization member please verify this patch?

@theforeman-bot
Copy link
Member

Issues: #24548

Copy link
Contributor

@ik5 ik5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments, they looks like a nitpick, sorry about it, but I think it will help this feature

@@ -52,6 +52,7 @@ def self.default_settings
self.set('query_local_nameservers', N_("Foreman will query the locally configured resolver instead of the SOA/NS authorities"), false, N_('Query local nameservers')),
self.set('remote_addr', N_("If Foreman is running behind Passenger or a remote load balancer, the IP should be set here. This is a regular expression, so it can support several load balancers, i.e: (10.0.0.1|127.0.0.1)"), "127.0.0.1", N_('Remote address')),
self.set('token_duration', N_("Time in minutes installation tokens should be valid for, 0 to disable token generation"), 60 * 6, N_('Token duration')),
self.set('ssh_timeout', N_("Time in seconds before SSH provisioning times out"), 60 * 6, N_('SSH timeout')),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the explanation of the unit that is used here.
For example "microseconds" for better understanding the calculation, and the value to place when setting it up.

Copy link
Contributor Author

@ianballou ianballou Aug 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ik5 I was assuming users would enter a time in seconds (Timeout default), which is why I made the help text say "Time in seconds ... ". I tried to follow how token_duration does it. Is there something more that you think I should add?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you actually make the default value of 2 minutes? Our old default was way to big, browser will kick you out already. Since it's configurable now users can change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll change it to 2 minutes.

@@ -72,7 +72,7 @@ def logger
end

def initiate_connection!
Timeout.timeout(360) do
Timeout.timeout(Setting[:ssh_timeout]) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add .to_i, that is:

Timeout.timeout(Setting[:ssh_timeout].to_i) do

in order to make sure that it is actually gets an integer rather then unknown type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add that

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 1a5ed3e must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@lzap
Copy link
Member

lzap commented Aug 10, 2018

I think [test] will fail because this needs to be added to fixtures/setting.yml.

Copy link
Member

@lzap lzap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you so much!

@lzap lzap merged commit 13b06b3 into theforeman:develop Aug 13, 2018
@ianballou ianballou deleted the configure-ssh-timeout branch August 13, 2018 13:51
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.

4 participants