Skip to content
Snippets Groups Projects
  1. Mar 05, 2012
    • Nat Goodspeed's avatar
      Additional diagnostic code to track down strange Windows pipe error. · 2491e2bd
      Nat Goodspeed authored
      It seems that under certain circumstances, write logic was duplicating a chunk
      of the data being streamed down our pipe. But as this condition is only driven
      with a very large data stream, eyeballing that data stream is tedious. Add
      code to compare the raw received data with the expected stream, reporting
      where and how they first differ.
      2491e2bd
    • Nat Goodspeed's avatar
      Introduce (disabled) LLLeap debugging code to validate stdin writes. · 63b393da
      Nat Goodspeed authored
      While debugging mysterious problem on Windows, one potential failure mode to
      rule out was the possibility that streaming std::ostringstream <<
      LLSDNotationStreamer(large_LLSD) might itself cause trouble -- even before
      attempting to write to the LLProcess::WritePipe. The debugging code validated
      that the correct length is being reported, and that deserializing the
      resulting buffer produces equivalent LLSD. This code verified correct
      operation, and so has been disabled, as it's expensive at runtime.
      63b393da
    • Nat Goodspeed's avatar
      Make test.cpp support LOGFAIL env var: only failed tests show log. · f02ded46
      Nat Goodspeed authored
      Set LOGFAIL= one of ALL, DEBUG, INFO, WARN, ERROR, NONE. A passing test will
      run silently, as now; but a failing test will replay log output at the
      specified level or higher.
      While at it, support LOGTEST environment variable, same values. This is like
      setting --debug (or -d), but allows specifying an arbitrary level -- and,
      unlike --debug, can be set for a TeamCity build config without modifying any
      scripts or code.
      Publish LLError::decodeLevel(std::string), previously private to llerror.cpp.
      f02ded46
    • Nat Goodspeed's avatar
      Move std::ostream << CaptureLog logic into CaptureLog::streamto(). · b3b51f01
      Nat Goodspeed authored
      That lets us reliably declare the operator<<() free function inline, which
      permits multiple translation units in the same executable to #include
      "wrapllerrs.h".
      b3b51f01
  2. Mar 04, 2012
    • Nat Goodspeed's avatar
      Simplify llleap_test.cpp plugin by reading individual characters. · 30e8e23d
      Nat Goodspeed authored
      While we're accumulating the 'length:' prefix, the present socket-based logic
      reads 20 characters, then reads 'length' more, then discards any excess (in
      case the whole 'length:data' packet ends up being less than 20 characters).
      That's probably a bug: whatever characters follow that packet, however short
      it may be, are probably the 'length:' prefix of the next packet. We probably
      only get away with it because we probably never send packets that short.
      Earlier llleap_test.cpp plugin logic still read 20 characters, then, if there
      were any left after the present packet, cached them as the start of the next
      packet. This is probably more correct, but complicated. Easier just to read
      individual characters until we've seen 'length:', then try for exactly the
      specified length over however many reads that requires.
      30e8e23d
    • Nat Goodspeed's avatar
      Make llleap_test.cpp avoid hard limit on MSVC std::ostringstream max. · ca703b2b
      Nat Goodspeed authored
      In load testing, we have observed intermittent failures on Windows in which
      LLSDNotationStreamer into std::ostringstream seems to bump into a hard limit
      of 1048590 bytes. ostringstream reports that much buffered data and returns
      that much -- even though, on examination, the notation-serialized stream is
      incomplete at that point. It's our intention to load-test LLLeap and
      LLProcess, not the local iostream implementation; we hope that this kind of
      data volume is comfortably greater than actual usage. Back off the
      load-testing max size a bit.
      ca703b2b
  3. Mar 03, 2012
  4. Mar 02, 2012
  5. Mar 01, 2012
  6. Feb 29, 2012
    • Nat Goodspeed's avatar
      When constructing a pipe to child stdin on Posix, ignore SIGPIPE. · 40dc3e0d
      Nat Goodspeed authored
      We can't count on every child process reading everything we try to write to
      it. And if the child terminates with WritePipe data still pending, unless we
      explicitly suppress it, Posix will hit us with SIGPIPE. That would terminate
      the calling process, boom. "Ignoring" it means APR gets the correct errno,
      passes it back to us, we log it, etc.
      40dc3e0d
    • Nat Goodspeed's avatar
      Guarantee LLProcess::Params::postend listener any ReadPipe data. · 3649eda6
      Nat Goodspeed authored
      Previously one might get process-terminated notification but still have to
      wait for the child process's final data to arrive on one or more ReadPipes.
      That required complex consumer timing logic to handle incomplete pending
      ReadPipe data, e.g. a partial last line with no terminating newline. New code
      guarantees that by the time LLProcess sends process-terminated notification,
      all pending pipe data will have been buffered in ReadPipes.
      Document LLProcess::ReadPipe::getPump() notification event; add "eof" key.
      Add LLProcess::ReadPipe::getline() and read() convenience methods.
      Add static LLProcess::getline() and basename() convenience methods, publishing
      logic already present elsewhere.
      Use ReadPipe::getline() and read() in unit tests.
      Add unit test for "eof" event on ReadPipe::getPump().
      Add unit test verifying that final data have been buffered by termination
      notification event.
      3649eda6
  7. Feb 27, 2012
  8. Feb 26, 2012
  9. Feb 24, 2012
    • Nat Goodspeed's avatar
      Get rid of indra/llcommon/tests/setpython.py. · d2faf5d2
      Nat Goodspeed authored
      run_build_test.py already has the capability to set environment variables, and
      we may as well direct it to set PYTHON to the running Python interpreter. That
      completely eliminates one level of process wrapper.
      d2faf5d2
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      Add LLStringUtil::getTokens() overload handling quoted substrings. · 025329b6
      Nat Goodspeed authored
      We didn't have any tokenizer suitable for scanning something like a bash
      command line. We do have a couple hacks, e.g. LLExternalEditor::tokenize() and
      LLCommandLineParser::parseCommandLineString(). Both try to work around
      boost::tokenizer limitations; but existing boost::tokenizer support just
      doesn't address this case. Neither of the above is available as a general
      scanner anyway, and parseCommandLineString() fails outright when passed "".
      New getTokens() also distinguishes between "drop delimiters" (e.g. space,
      return, newline) to be discarded from the token stream, versus "keep
      delimiters" (e.g. "+-*/") to be returned as tokens in their own right.
      There's an overload that honors escapes and a more efficient one that doesn't;
      each has a convenience overload that returns the scanned string vector rather
      than requiring a separate declaration.
      Tweak and comment older getTokens() implementation.
      Add unit tests for both old and new getTokens() implementations.
      Break out StringVec and std::ostream << StringVec from
      indra/llcommon/tests/listener.h to StringVec.h: that's coming in handy for a
      number of different TUT test sources.
      025329b6
  10. Feb 23, 2012
    • Nat Goodspeed's avatar
      Tighten up LLProcess pipe support, per Richard's code review. · 14ddc647
      Nat Goodspeed authored
      Clarify wording in some of the doc comments; be a bit more explicit about some
      of the parameter fields.
      Make some query methods 'const'.
      Change default LLProcess::ReadPipe::getLimit() value to 0: don't post any
      incoming data with notification event unless caller requests it. But do post
      pertinent FILESLOT in case caller reuses same listener for both stdout and
      stderr.
      Use more idiomatic, readable syntax for accessing LLProcess::Params data.
      14ddc647
  11. Feb 20, 2012
    • Nat Goodspeed's avatar
      Let LLProcess consumer specify desired description for logging. · 999484a6
      Nat Goodspeed authored
      If caller runs (e.g.) a Python script, it's not very helpful to a human log
      reader to keep seeing LLProcess instances logged as /pathname/to/python (pid).
      If caller is aware, the code can at least use the script name as the desc --
      or maybe even a hint as to the script's purpose.
      If caller doesn't explicitly pass a desc, at least shorten to just the
      basename of the executable.
      999484a6
    • Nat Goodspeed's avatar
      Make LLProcess post termination event to specified pump if desired. · 8b5d5f96
      Nat Goodspeed authored
      This way a caller need not spin on isRunning(); we can just listen for the
      requested termination event.
      Post a similar event containing error message if for any reason
      LLProcess::create() failed to launch the child.
      Add unit tests for both cases.
      8b5d5f96
  12. Feb 18, 2012
Loading