Message179838
"The tempfile module has a specialized RNG that re-initialized the RNG after fork() by comparing os.getpid() to an instance variable every time the RNG is accessed. The check can be replaced with an afterfork callback."
By the way, OpenSSL expects that its PRNG is reseed somehow (call RNG_add) after a fork. I wrote a patch for OpenSSL, but I don't remember if I sent it to OpenSSL.
https://bitbucket.org/haypo/hasard/src/4a1be69a47eb1b2ec7ca95a341d4ca953a77f8c6/patches/openssl_rand_fork.patch?at=default
Reseeding tempfile PRNG is useless (but spend CPU/memory/hang until we have enough entropy?) if the tempfile is not used after fork. I like the current approach.
--
I'm not saying that a new atfork module would not help, just that the specific case of tempfile should be discussed :-) I like the idea of a generic module to call code after fork. |
|
Date |
User |
Action |
Args |
2013-01-12 23:37:35 | vstinner | set | recipients:
+ vstinner, twouters, gregory.p.smith, jcea, amaury.forgeotdarc, pitrou, christian.heimes, grahamd, asvetlov, sbt |
2013-01-12 23:37:35 | vstinner | set | messageid: <1358033855.49.0.878450514405.issue16500@psf.upfronthosting.co.za> |
2013-01-12 23:37:35 | vstinner | link | issue16500 messages |
2013-01-12 23:37:34 | vstinner | create | |
|