tombstoned: don't increment num_concurrent_dumps until success.

Previously, we would increment num_concurrent_dumps and fail to
decrement it if we failed to start the request. Change this to
only increment after we've successfully started the dump.

Bug: http://b/36685795
Test: debuggerd_test
Change-Id: I66169ed56ed44271e1d8fe1298d95260be7a32a3
This commit is contained in:
Josh Gao 2017-03-30 14:42:46 -07:00
parent 6fb2ef1d03
commit 13078245a0

View file

@ -127,8 +127,6 @@ static unique_fd get_tombstone_fd() {
}
static void dequeue_request(Crash* crash) {
++num_concurrent_dumps;
unique_fd output_fd;
if (!intercept_manager->GetIntercept(crash->crash_pid, &output_fd)) {
output_fd = get_tombstone_fd();
@ -153,6 +151,8 @@ static void dequeue_request(Crash* crash) {
crash_completed_cb, crash);
event_add(crash->crash_event, &timeout);
}
++num_concurrent_dumps;
return;
fail: