membphis commented on a change in pull request #2357:
URL: https://github.com/apache/apisix/pull/2357#discussion_r501388573
##########
File path: apisix/init.lua
##########
@@ -82,6 +75,14 @@ end
function _M.http_init_worker()
+ local seed, err = core.utils.get_seed_from_urandom()
+ if not seed then
+ core.log.warn('failed to get seed from urandom: ', err)
+ seed = ngx_now() * 1000 + ngx.worker.pid()
+ end
+ math.randomseed(seed)
+ core.log.info("random test in [1, 10000]: ", math.random(1, 1000000))
Review comment:
it not for the user, the developer need it for testing.
here is the code link of the test case:
https://github.com/apache/apisix/pull/2357/files#diff-a46ca98b2569d841ad4742ef90427a1fR39
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]