Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Bug 1490456 - bug fixes in recycling timing #13

Merged
merged 2 commits into from
Sep 12, 2018

Conversation

djmitche
Copy link
Contributor

The first commit is pretty straightforward; the second is a more substantial refactor of timer handling. I recognize that it changes the behavior a little bit, in that it completely ignores recycleInterval when using a credentials function that returns recycleAt, but I think that's OK -- the idea of recycleInterval is just to make sure we don't stay connected forever, and recycleAt accomplishes that goal too.

Handle the case where a connection has already been retired when we
start to connect to it; also use `newConn.failed()` when connecting
fails, as that will only recycle if the connection hasn't already been
retired.

This also fixes the test: the comment said 10ms but the code said 20ms;
10ms was the correct answer.
- always return a Date instance from credentials functions

- simplify the recycling timing into one timer, which it is careful to
  clear before resetting.  Since it's difficult to test timers, simpler is
  better. It's handled in a single function, separate from credential
  fetching.
@djmitche djmitche self-assigned this Sep 11, 2018
@djmitche djmitche requested a review from Biboswan September 11, 2018 21:43
@djmitche djmitche merged commit 466ec16 into taskcluster:master Sep 12, 2018
@djmitche
Copy link
Contributor Author

v2.0.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants