#20884: line buffering in sage-logger causes "hang" due to invisible prompt when
installing experimental packages
-------------------------------------+-------------------------------------
       Reporter:  mkoeppe            |        Owner:
           Type:  defect             |       Status:  closed
       Priority:  critical           |    Milestone:  sage-7.3
      Component:  build              |   Resolution:  fixed
       Keywords:                     |    Merged in:
        Authors:  Erik Bray          |    Reviewers:  Dima Pasechnik,
                                     |  Matthias Koeppe
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  705573623266f1017aa4a433e816c0e878960836|
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by embray):

 * commit:  705573623266f1017aa4a433e816c0e878960836 =>


Comment:

 > How about simply changing the scripts to output a newline when prompting
 the user for something, at least when the sage-logger is used?

 Those scripts don't necessarily have any way to know that `sage-logger` is
 being used, nor should they.

 I think the test of just `cat`ting is not quite fair either.  In a real
 build the overhead of the commands being run far outweighs the overhead of
 the logger.  For example running `make patch` on current `develop` I got:

 ```
 real    2m14.225s
 user    0m29.614s
 sys     1m2.397s
 ```

 while on my branch:

 ```
 real    2m18.844s
 user    0m38.751s
 sys     1m4.341s
 ```

 So maybe possibly a little slower but hard to say from a single data
 point.

 There's no need to emphasize ''shell loop'' since it's using only shell
 built-ins, or should be, so that shouldn't be a significant source of
 overhead.  Ultimately `sed` is looping over one character at a time too.
 One thing that might speed this up a bit is to not `printf` for every
 character, but at least buffer that.

 Still, point partly taken.  I might prefer to go with my earlier instinct
 and just rewrite it in Python.  I think using `sed` just to prepend to a
 line also feels like a blunt instrument.

--
Ticket URL: <https://trac.sagemath.org/ticket/20884#comment:53>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to