[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-24 Thread Charles-François Natali
Changes by Charles-François Natali : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 53a2488605e3 by Charles-François Natali in branch 'default': Issue #14154: Reimplement the bigmem test memory watchdog as a subprocess. http://hg.python.org/cpython/rev/53a2488605e3 -- nosy: +python-dev

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-20 Thread STINNER Victor
STINNER Victor added the comment: mem_watchdog_2.diff looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-20 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch flushing stdout explicitely (should not be necessay unless the watchdog crashes, but...). Also, redirect stderr to /dev/null. -- Added file: http://bugs.python.org/file24974/mem_watchdog_2.diff __

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-19 Thread STINNER Victor
STINNER Victor added the comment: memory_watchdog.py should probably use sys.stdout.flush(), and you should replace print("...") by sys.stdout.write("...\n") to only call sys.stdout.write once (print calls write a second time just to write the newline). +1 for the subprocess instead of the th

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-03-19 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a new version, with a dedicated script for the watchdog process. -- Added file: http://bugs.python.org/file24950/mem_watchdog_1.diff ___ Python tracker ___

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-29 Thread STINNER Victor
STINNER Victor added the comment: >> + f = open(self.procfile, 'r') >> >> 'rb' mode is enough here, no need of Unicode ;-) > > Why? The parent process doesn't read the file content, only the child. The parent only needs a file descriptor. >> + self.mem_watchdog = subprocess.Popen(..., stdin=f)

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-29 Thread Charles-François Natali
Charles-François Natali added the comment: > + f = open(self.procfile, 'r') > > 'rb' mode is enough here, no need of Unicode ;-) Why? At least to me, 'r' stands for text I/O, whereas 'rb' stands for binary I/O: here, I want to read /proc//statm, which is a textual representation of the memory u

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-28 Thread STINNER Victor
STINNER Victor added the comment: A subprocess looks simpler (and safer?) than a C thread with a pipe. + f = open(self.procfile, 'r') 'rb' mode is enough here, no need of Unicode ;-) + self.mem_watchdog = subprocess.Popen(..., stdin=f) Can't you open the /proc/pid/stat file in the child proc

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's so much simpler that I feel a bit ridiculous with my earlier solution :) -- nosy: +haypo ___ Python tracker ___ __

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-28 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue14154] reimplement the bigmem test memory watchdog as a subprocess

2012-02-28 Thread Charles-François Natali
New submission from Charles-François Natali : As suggested in http://bugs.python.org/msg154330, here's a rewrite of the test memory watchdog using subprocess instead of thread + faulthandler. -- components: Tests files: mem_watchdog_subprocess.diff keywords: needs review, patch messages