-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use parse_duration for fed client timeout/retry options #15778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for drive-by while in draft. Do docs need updating?
@@ -404,10 +404,10 @@ def __init__( | |||
self.clock = hs.get_clock() | |||
self._store = hs.get_datastores().main | |||
self.version_string_bytes = hs.version_string.encode("ascii") | |||
self.default_timeout = hs.config.federation.client_timeout | |||
self.default_timeout = hs.config.federation.client_timeout / 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in seconds now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse_duration
returns milliseconds.
else: | ||
_sec_timeout = self.default_timeout | ||
if timeout is None: | ||
timeout = int(self.default_timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is also in seconds now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For bonus points, leave a comment saying this is in seconds/milliseconds/whatever.
For a gold star, rename to self.timeout_seconds
etc!
if timeout is None: | ||
timeout = int(self.default_timeout) | ||
|
||
_sec_timeout = timeout / 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which means that this is in kiloseconds if timeout is None
, but seconds otherwise. That seems wrong.
Ditto below.
@DMRobertson docs do need some update, seems like I did the changes and then didn't commit them... |
Superseeded by #15783. |
Pull Request Checklist
(run the linters)