You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Do function of httpclient.clientImpl uses rand.Intn(len(uris)) to determine the offset that should be used for the URI.
This code uses the global source for randomness, so unless the client application explicitly seeds the global random source, the sequence of offsets that this code chooses will always be the same.
This is not necessarily an issue in and of itself, but does seem somewhat counter-intuitive. Possible approaches:
Document that sequence of offsets chosen will be deterministic unless global source of randomness is seeded
Store *rand.Rand as part of the client and seed it on construction (and optionally expose a way to disable seeding it/specifying a seed manually if there is a desire to control the sequence)
The text was updated successfully, but these errors were encountered:
Currently, the
Do
function ofhttpclient.clientImpl
usesrand.Intn(len(uris))
to determine the offset that should be used for the URI.This code uses the global source for randomness, so unless the client application explicitly seeds the global random source, the sequence of offsets that this code chooses will always be the same.
This is not necessarily an issue in and of itself, but does seem somewhat counter-intuitive. Possible approaches:
*rand.Rand
as part of the client and seed it on construction (and optionally expose a way to disable seeding it/specifying a seed manually if there is a desire to control the sequence)The text was updated successfully, but these errors were encountered: