diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-03-05 19:00:23 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-03-05 19:00:23 -0500 |
commit | e7ceb82e71ed88354758c6f16525aa051d47bdec (patch) | |
tree | b48519df19c92eff2cb70ea82556d7c1683b9eef /indra/llcommon | |
parent | 2491e2bda53ac3a1f2f021e425e7c7c4859e68ad (diff) |
Further reduce the block size that LLProcess writes to child pipe.
It seems that on Windows, even 32K is too big: one in three load-test runs
fails with a duplicated block. Empirically, reducing it to 4K makes it much
more stable -- at least we can run successfully 100 consecutive times, which
is a step in the right direction.
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llprocess.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index d926791e9e..178ec064c0 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -181,8 +181,15 @@ public: { // Tackle the current buffer in discrete chunks. On // Windows, we've observed strange failures when trying to - // write big lengths (~1 MB) in a single operation. - std::size_t towrite((std::min)(remainlen, std::size_t(32*1024))); + // write big lengths (~1 MB) in a single operation. Even a + // 32K chunk seems too large. At some point along the way + // apr_file_write() returns 11 (Resource temporarily + // unavailable, i.e. EAGAIN) and says it wrote 0 bytes -- + // even though it did write the chunk! Our next write + // attempt retries with the same chunk, resulting in the + // chunk being duplicated at the child end. Using smaller + // chunks is empirically more reliable. + std::size_t towrite((std::min)(remainlen, std::size_t(4*1024))); apr_size_t written(towrite); apr_status_t err = apr_file_write(mPipe, remainptr, &written); // EAGAIN is exactly what we want from a nonblocking pipe. |