Closed inevity closed 7 years ago
Hi,
Yes indeed, that is why libraries should never call math.randomseed
on their own, and always let the user decide when and how to seed their application. Which is what this library is doing.
BTW, as this library's README warns, if you are seeding in init_by_lua
then your workers are generating identical sequences of random numbers (and thus, identical UUIDs if you use this library). You should refer to this lib's README how to fix that.
I proposed https://github.com/openresty/lua-resty-core/pull/92 to OpenResty to address this issue you described for all OpenResty users, but it was not accepted (I think the issue wasn't given the attention it deserved tbh).
using math.random for seeding in init_by_lua maybe overwrite by a math.random from other module .