Increase the size limit of incident reports.

am: 318296726d

Change-Id: I3ac66bba8d302fb5b1748d03cc76b030fde26827
This commit is contained in:
Yao Chen
2019-05-23 15:34:11 -07:00
committed by android-build-merger
6 changed files with 12 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ namespace os {
namespace incidentd {
const ssize_t BUFFER_SIZE = 16 * 1024; // 16 KB
const ssize_t MAX_BUFFER_COUNT = 1536; // 24 MB max
const ssize_t MAX_BUFFER_COUNT = 6144; // 96 MB max
FdBuffer::FdBuffer()
:mBuffer(new EncodedBuffer(BUFFER_SIZE)),

View File

@@ -43,7 +43,7 @@ enum {
#define DEFAULT_DELAY_NS (1000000000LL)
#define DEFAULT_BYTES_SIZE_LIMIT (20 * 1024 * 1024) // 20MB
#define DEFAULT_BYTES_SIZE_LIMIT (96 * 1024 * 1024) // 96MB
#define DEFAULT_REFACTORY_PERIOD_MS (24 * 60 * 60 * 1000) // 1 Day
// Skip these sections for dumpstate only. Dumpstate allows 10s max for each service to dump.

View File

@@ -498,7 +498,7 @@ status_t ReportFile::load_envelope_impl(bool cleanup) {
WorkDirectory::WorkDirectory()
:mDirectory("/data/misc/incidents"),
mMaxFileCount(100),
mMaxDiskUsageBytes(30 * 1024 * 1024) { // Incident reports can take up to 30MB on disk.
mMaxDiskUsageBytes(100 * 1024 * 1024) { // Incident reports can take up to 100MB on disk.
// TODO: Should be a flag.
create_directory(mDirectory.c_str());
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -233,8 +233,8 @@ TEST_F(FdBufferTest, ReadInStreamEmpty) {
}
TEST_F(FdBufferTest, ReadInStreamMoreThan4MBWithMove) {
const std::string testFile = kTestDataPath + "morethan24MB.txt";
size_t twentyfourMB = (size_t)24 * 1024 * 1024;
const std::string testFile = kTestDataPath + "morethan96MB.txt";
size_t ninetySixMB = (size_t)96 * 1024 * 1024;
unique_fd fd(open(testFile.c_str(), O_RDONLY | O_CLOEXEC));
ASSERT_NE(fd.get(), -1);
int pid = fork();
@@ -254,21 +254,21 @@ TEST_F(FdBufferTest, ReadInStreamMoreThan4MBWithMove) {
ASSERT_EQ(NO_ERROR,
buffer.readProcessedDataInStream(fd, std::move(p2cPipe.writeFd()),
std::move(c2pPipe.readFd()), READ_TIMEOUT));
EXPECT_EQ(buffer.size(), twentyfourMB);
EXPECT_EQ(buffer.size(), ninetySixMB);
EXPECT_FALSE(buffer.timedOut());
EXPECT_TRUE(buffer.truncated());
wait(&pid);
sp<ProtoReader> reader = buffer.data()->read();
reader->move(twentyfourMB);
reader->move(ninetySixMB);
EXPECT_EQ(reader->bytesRead(), twentyfourMB);
EXPECT_EQ(reader->bytesRead(), ninetySixMB);
EXPECT_FALSE(reader->hasNext());
}
}
TEST_F(FdBufferTest, ReadInStreamMoreThan4MBWithNext) {
const std::string testFile = kTestDataPath + "morethan24MB.txt";
size_t twentyfourMB = (size_t)24 * 1024 * 1024;
const std::string testFile = kTestDataPath + "morethan96MB.txt";
size_t ninetySixMB = (size_t)96 * 1024 * 1024;
unique_fd fd(open(testFile.c_str(), O_RDONLY | O_CLOEXEC));
ASSERT_NE(fd.get(), -1);
int pid = fork();
@@ -288,7 +288,7 @@ TEST_F(FdBufferTest, ReadInStreamMoreThan4MBWithNext) {
ASSERT_EQ(NO_ERROR,
buffer.readProcessedDataInStream(fd, std::move(p2cPipe.writeFd()),
std::move(c2pPipe.readFd()), READ_TIMEOUT));
EXPECT_EQ(buffer.size(), twentyfourMB);
EXPECT_EQ(buffer.size(), ninetySixMB);
EXPECT_FALSE(buffer.timedOut());
EXPECT_TRUE(buffer.truncated());
wait(&pid);