New submission from Christian Heimes:

I have seen complains from e.g. Tarek that os.urandom() fails under high load: 
https://twitter.com/tarek_ziade/status/362281268215418880

The problem is caused by file descriptor limits. os.urandom() opens 
/dev/urandom for every call. How about os.urandom() uses a persistent file 
descriptor? That should eliminate the error. It may alsos speed up os.urandom() 
because a persistent FD gets rid of open() and close() syscalls.

* open /dev/urandom on first call of os.urandom() and store the fd in a static 
var
* invalidate, close fd on read() -> EINVAL; open /dev/urandom again
* close fd when interpreter shuts down

----------
components: Extension Modules
messages: 195338
nosy: christian.heimes, haypo, hynek, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: os.urandom() fails under high load
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to