twisted / twisted/twisted

HostnameEndpoint should have a deadline, not just a timeout.

Open
#9,152 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core enhancement new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

Lukasa's avatar @Lukasa reported
Trac ID trac#9152
Type enhancement
Created 2017-05-29 15:12:52Z

I've said this many times: users don't want timeouts, they want deadlines.

Right now HostnameEndpoint takes a per connection attempt timeout argument. This means if the hostname resolves to 50 IPs, HostnameEndpoint will take 50 * timeout seconds to actually timeout. This kind of interface is inevitably surprising to users and almost impossible to configure in a sensible way. No-one wants this interface, it's just the easiest one to code for.

What users want is to say "spend no more than 30 seconds attempting to connect, then give up". This is better expressed as a deadline than a timeout (though it can also be spelled totalTimeout if you prefer), and is what we should actually expose.

Searchable metadata
trac-id__9152 9152
type__enhancement enhancement
reporter__Lukasa Lukasa
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1496070772607098 1496070772607098
changetime__1496094095340545 1496094095340545
version__None None
owner__None None
cc__mithrandi@...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the HostnameEndpoint implementation and its existing tests, then read how the current per-connection-attempt timeout is applied across hostname resolution results. Define the change around a total deadline for the whole connection attempt, and update coverage so the operation gives up after the requested overall duration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.