Jira (PUP-9732) Client should cache successful host address for at least the length of a Puppet run

13 views
Skip to first unread message

Jorie Tappa (JIRA)

unread,
Jun 7, 2019, 11:25:03 AM6/7/19
to puppe...@googlegroups.com
Jorie Tappa created an issue
 
Puppet / Task PUP-9732
Client should cache successful host address for at least the length of a Puppet run
Issue Type: Task Task
Assignee: Unassigned
Created: 2019/06/07 8:24 AM
Priority: Normal Normal
Reporter: Jorie Tappa

Instead of trying all addresses of a host every single time, we should cache the successful address from our initial connection for reuse for at least the length of a single puppet run.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Jorie Tappa (JIRA)

unread,
Jun 7, 2019, 11:26:03 AM6/7/19
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Jun 10, 2019, 12:47:03 PM6/10/19
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Jun 12, 2019, 4:57:04 PM6/12/19
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Instead of trying all addresses of a host every single time, we should cache the successful address from our initial connection for reuse for at least the length of a single puppet run.

What can be done besides monkey patching ruby or submitting a patch to ruby? Net::Http in ruby controls this so we're unsure if there's anything on our side that can be done to resolve this.

Jorie Tappa (JIRA)

unread,
Jun 12, 2019, 5:00:03 PM6/12/19
to puppe...@googlegroups.com
Jorie Tappa updated an issue
Instead of trying all addresses of a host every single time, we should cache the successful address from our initial connection for reuse for at least the length of a single puppet run.

What can be done besides monkey patching ruby or submitting a patch to ruby? Net::Http in ruby controls this so we're unsure if there's anything on our side that can be done to resolve this.


An alternative if we can't come up with a solution is to tune timeouts to minimize impact.

Jorie Tappa (JIRA)

unread,
Jul 8, 2019, 2:44:04 PM7/8/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Aug 12, 2019, 6:21:03 PM8/12/19
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-9732
 
Re: Client should cache successful host address for at least the length of a Puppet run

The current agent behavior may be good enough here, because it uses persistent HTTP connections. So during a normal agent run, it will try to reuse the same TCP connection. If the connection is idle, such as due to a long running exec, package install, etc, then the agent will timeout the idle connection and create a new one, retriggering the lookup. But that's more of the exception than the rule.

If we need to do something more than that, then we probably want to handle the DNS resolution ourselves via Resolv::DNS and store the resolved IP address for the run. However, we'll have to do some extra work to handle the certname mismatch since the IP we tried to connect to doesn't match the server's certname.

Kris Bosland (JIRA)

unread,
Aug 22, 2019, 2:25:02 PM8/22/19
to puppe...@googlegroups.com
Kris Bosland commented on Task PUP-9732

Does server_list get tried multiple times during a puppet run?  That might be worth caching too.

Josh Cooper (JIRA)

unread,
Aug 22, 2019, 5:06:04 PM8/22/19
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-9732

We only resolve server_list once at the beginning and use that for the duration of the run.

Rob Braden (JIRA)

unread,
Sep 24, 2019, 2:48:05 PM9/24/19
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 13, 2020, 1:36:03 AM3/13/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-9732
 
Re: Client should cache successful host address for at least the length of a Puppet run

The http client work eliminates this issue. Puppet will know resolve puppet web services (compiler, fileserver, report, etc) using one of 3 resolvers (SRV, server list, settings) depending how the agent is configured. Once a successful route (server and host) is found, it is reused for all future connections to that web service endpoint.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages