Skip to content

Commit

Permalink
reader_permit: release_base_resources(): also update _resources
Browse files Browse the repository at this point in the history
If the permit was admitted, _base_resources was already accounted in
_resource and therefore has to be deducted from it, otherwise the permit
will think it leaked some resources on destruction.

Test:
dtest(repair_additional_test.py.test_repair_one_missing_row_diff_shard_count)

Refs: #9751
Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <20220119132550.532073-1-bdenes@scylladb.com>
(cherry picked from commit a65b38a)
  • Loading branch information
denesb authored and avikivity committed Jan 20, 2022
1 parent 2c65c4a commit 0f7f858
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reader_concurrency_semaphore.cc
Expand Up @@ -250,6 +250,10 @@ class reader_permit::impl
}

void release_base_resources() noexcept {
if (_base_resources_consumed) {
_resources -= _base_resources;
_base_resources_consumed = false;
}
_semaphore.signal(std::exchange(_base_resources, {}));
}

Expand Down

0 comments on commit 0f7f858

Please sign in to comment.