New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p_iter_fork doesn't flush stdout properly #11778
Comments
comment:1
The attached patch fixes the problem, but it probably still needs a doctest. |
comment:2
How about |
Author: Johan Bosman |
Reviewer: Leif Leonhardy |
comment:4
In general I'd move the |
comment:5
Replying to @nexttime:
Okay. ;) |
comment:6
Attachment: 11778_flush_before_fork.patch.gz And now stderr as well. |
comment:7
Replying to @sagetrac-johanbosman:
Sorry, not your problem here, but IMHO the output should also be flushed after every |
comment:8
Oh, actually not just verbose mode. |
comment:9
Okay, so you're saying this stderr flush can be left out? Flushing is time consuming so it'd be better to flush as little as possible. |
comment:10
Replying to @sagetrac-johanbosman:
No. The subprocesses shouldn't inherit an unflushed buffer. I can add a reviewer patch for flushing the output of the |
comment:11
Okay, go ahead; I don't want to change this patch. ;). |
Sage library patch. Also flushs the output of further |
comment:12
Attachment: trac_11778-flush_output_of_print_stmts.reviewer.patch.gz Replying to @sagetrac-johanbosman:
Gone. If you're ok with my additional changes, we have a positive review. |
comment:13
There's a typo (which was already there): Okay, that was "mierenneuken" (you may want to look up that word); I'll have a more serious look it later on (don't have much time right now). |
comment:14
Replying to @sagetrac-johanbosman:
I'd say a comma there isn't absolutely necessary, but I should have added periods... (I saw that of courseTM after I had committed my changes.)
"De pagina "mierenneuken" aanmaken op deze wiki." Guessing nit-picking.
Go ahead... ;-) |
comment:15
Replying to @nexttime:
Have a look at http://en.wikipedia.org/wiki/Comma#Separation_of_clauses ;). |
comment:16
Replying to @sagetrac-johanbosman:
Well, since "which" refers to a single subprocess, it is unambiguous. (But you're in principle right, omitting the comma might be considered a bit sloppy, as the clause is non-restrictive from a grammatical point of view. I'd say it is restrictive, or constraining, from a logical point of view though, as the subprocess wouldn't have been killed in that situation otherwise, i.e. if it had not taken too long.) We could also change "which took too long" to "because it took too long"... :) |
comment:17
Replying to @nexttime:
I'm okay with it. Let's not worry about the comma, which is mierenneuken anyway (the word is explained at http://en.wikipedia.org/wiki/Dutch_profanity) ;). |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.7.2.alpha3 |
The following code
gives this output (perhaps in a different order):
The point is that stdout isn't flushed before the process is forked and therefore its contents are copied to the child process as well and thus lives in 2 processes.
Apply
to the Sage library.
Component: misc
Keywords: parallel fork stdout
Author: Johan Bosman
Reviewer: Leif Leonhardy
Merged: sage-4.7.2.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/11778
The text was updated successfully, but these errors were encountered: