moonming commented on a change in pull request #2357:
URL: https://github.com/apache/apisix/pull/2357#discussion_r501085354
##########
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:
Can it help user to find any problems?
----------------------------------------------------------------
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]