Fix a potential std::vector use after move bug (#10845)

Summary:
The call to `folly::coro::collectAllRange()` should move the input `mget_tasks`. But just in case, assert and clear the std::vector before reusing.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10845

Reviewed By: akankshamahajan15

Differential Revision: D40611719

Pulled By: anand1976

fbshipit-source-id: 0f32b387cf5a2894b13389016c020b01ab479b5e
main
anand76 2 years ago committed by Facebook GitHub Bot
parent 5d3953114f
commit 5fef34fd3a
  1. 1
      db/version_set.cc

@ -2833,6 +2833,7 @@ Status Version::MultiGetAsync(
std::vector<Status> statuses = folly::coro::blockingWait(
folly::coro::collectAllRange(std::move(mget_tasks))
.scheduleOn(&range->context()->executor()));
mget_tasks.clear();
for (Status stat : statuses) {
if (!stat.ok()) {
s = stat;

Loading…
Cancel
Save