Opened 11 years ago

Closed 6 years ago

#4734 defect closed wontfix (wontfix)

Problem with of ReconnectingClientFactory.maxDelay

Reported by: Albert Brandl Owned by: Albert Brandl
Priority: low Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

The ReconnectingClientFactory has an attribute maxDelay, which is documented as "Maximum number of seconds between connection attempts."

This documentation only is correct if no jitter is defined. Otherwise, the jitter is taken into account after the delay has been bounded by maxDelay, possibly resulting in a value that is considerably larger than maxDelay.

The two main options discussed in the mailing list are:

  1. Change the documentation for maxDelay to indicate that this delay is not maximal after all (maybe the name should then be changed, too).
  2. Fix the calculation of the delay.

When the calculation is fixed, we have to be careful not to impair the even distribution of delays: we don't want the case that all clients use the same value (e.g. maxDelay) for connection attempts!

This should be possible by modifying the call to random.normalvariate in the right way.

Change History (4)

comment:1 Changed 11 years ago by Glyph

Owner: changed from Glyph to Albert Brandl

I won't get in the way of this being fixed, but I think that the best thing to do here would be to add new code that works nicely with endpoints and has a more sensible variable naming convention, then deprecate ReconnectingClientFactory and eventually get rid of it.

But, we have a few more years of maintenance of this code, so go ahead if you want to submit a patch.

comment:2 Changed 11 years ago by Glyph

I filed #4735 to explain the specs for that idea in a bit more detail. Also related: #4510, #4472, #4699, #4700.

comment:3 Changed 11 years ago by Glyph

Priority: normallow

comment:4 Changed 6 years ago by Glyph

Resolution: wontfix
Status: newclosed

5 years with no progress, and the replacement is now in review again; I am just going to close this because it seems unlikely it will ever be done (and if someone has time to work on Twisted they should work on something else).

Thanks for spotting the error, but hopefully we can just deprecate ReconnectingClientFactory in a year or two and everyone will move to the new, shiny ClientService :-).

Note: See TracTickets for help on using tickets.