binarymatt / pyres

a resque clone in python
http://github.com/binarydud/pyres
MIT License
955 stars 130 forks source link

jobs spawned by a single worker share the same PRNG seed #82

Closed pteichman-litl closed 12 years ago

pteichman-litl commented 12 years ago

At some point during pyres_worker startup, the Python pseudo-random number is seeded. Since pyres_worker doesn't generate any random numbers during normal operation, all jobs spawned from a single worker share the same PRNG state.

Found because my jobs were generating the same result from random.randint(0, 100000000) hour after hour. I'll submit a patch.