diff options
| author | 2017-08-17 21:43:21 -0700 | |
|---|---|---|
| committer | 2017-08-17 21:46:46 -0700 | |
| commit | 175f34c5c32d6b52b6fb588900d019d5f1772888 (patch) | |
| tree | 6b0a1be319ec1a3cfb00121ed287b6a7bcc9d95a /java/java_test.go | |
| parent | fd697f425657d6f443def3f0b1862888b0095bac (diff) | |
Revert "Revert "Refactor rate_limit.go for more clarify""
This reverts commit 526416b1e49931b13948d1ccff8d50f2c1b4d178.
Figured out a fix for the deadlocks; resubmitting the patch.
The first version was deadlocking because the switch statement in
zipWriter.write would choose a specific zip entry to start writing,
but the individual chunks may not have all necessarily been compressed
yet. When each individual chunk was made to require to request its own
allocations, the compression of the chunks of the file being currently
written could be blocked waiting for memory to be freed by chunks from
other files that hadn't yet started being written.
This patch is much like the original except it preallocates the memory
for the entire file upfront (and happens to use the total file size
rather than the compressed size, but I didn't observe that to cause any
performance differences).
Bug: 64536066
Test: m -j dist showcommands # which runs soong_zip to package everything
Change-Id: Id1d7ff415e54d3a6be71188abbdbbbab5a719fcf
Diffstat (limited to 'java/java_test.go')
0 files changed, 0 insertions, 0 deletions