Opened 16 years ago

Closed 8 years ago

#1822 enhancement closed fixed (fixed)

connectTCP should re-resolve domain names on each connection attempt

Reported by: itamarst Owned by: Jean-Paul Calderone
Priority: low Milestone:
Component: core Keywords: documentation
Cc: Branch: branches/resolution-docs-1822
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun

Description

This is helpful for connecting to places that do round-robin-DNS or failover based on DNS change, or even for long running processes dealing with regular DNS change.

Even if it already does so, we should document this behavior and add test.

Change History (14)

comment:1 Changed 16 years ago by Glyph

It should probably re-resolve, but then recommend that if you need to make multiple connection attempts, you resolve and cache the IP somewhere yourself.

comment:2 Changed 16 years ago by Jean-Paul Calderone

It should respect normal DNS caching rules. It may invoke the resolver before each connection attempt, but that resolver should be free to give back a cached result.

comment:3 Changed 13 years ago by SeanMcQ

Owner: changed from Glyph to SeanMcQ

comment:4 in reply to:  2 Changed 13 years ago by SeanMcQ

Replying to exarkun:

It should respect normal DNS caching rules. It may invoke the resolver before each connection attempt, but that resolver should be free to give back a cached result.

Per RFC1123 section 6.1.3.1 (A) resolver implementations MUST implement caching and the cache MUST timeout. (ftp://ftp.rfc-editor.org/in-notes/rfc1123.txt)

comment:5 Changed 13 years ago by SeanMcQ

Owner: changed from SeanMcQ to Itamar Turner-Trauring

Can you please provide more information. It appears all DNS lookup paths implement caching with a timeout or defer it to the operating system to cache which is per spec. The names library implements an empty cache, which technically meets the spec and is not used in the normal tcp connection path.

If you could provide more details about the expected behavior and where it deviates it would be helpful.

comment:6 Changed 10 years ago by Itamar Turner-Trauring

Owner: Itamar Turner-Trauring deleted

comment:7 Changed 10 years ago by Jean-Paul Calderone

Keywords: documentation tests added

comment:8 Changed 8 years ago by Jean-Paul Calderone

Keywords: tests removed

I agree with SeanMcQ's last comment.

comment:9 Changed 8 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/resolution-docs-1822

(In [41355]) Branching to 'resolution-docs-1822'

comment:10 Changed 8 years ago by Jean-Paul Calderone

Keywords: review added

I added some minor docs.

comment:11 Changed 8 years ago by Jonathan Jacobs

Keywords: review removed
Owner: set to Jean-Paul Calderone

This looks good to me. Thanks for cleaning up the whitespace in the rest of the document.

comment:12 Changed 8 years ago by Hynek Schlawack

May I suggest reflowing lines where whitespace got killed around (such as 26ff)? Due to the empty lines there’s churn anyway…

comment:13 Changed 8 years ago by Jean-Paul Calderone

(In [41360]) Semantic linefeeds for lines that are changing anyway.

refs #1822

comment:14 Changed 8 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [41361]) Merge resolution-docs-1822

Author: exarkun Reviewer: jonathanj, hynek Fixes: #1822

Add some documentation to the client howto about how name resolution works with connectTCP.

Note: See TracTickets for help on using tickets.