treewide: silence discarded future warnings for questionable discards

This patches silences the remaining discarded future warnings, those
where it cannot be determined with reasonable confidence that this was
indeed the actual intent of the author, or that the discarding of the
future could lead to problems. For all those places a FIXME is added,
with the intent that these will be soon followed-up with an actual fix.
I deliberately haven't fixed any of these, even if the fix seems
trivial. It is too easy to overlook a bad fix mixed in with so many
mechanical changes.
This commit is contained in:
Botond Dénes
2019-08-13 13:48:19 +03:00
parent fddd9a88dd
commit 136fc856c5
17 changed files with 87 additions and 44 deletions

View File

@@ -550,7 +550,8 @@ public:
*/
future<sseg_ptr> finish_and_get_new(db::timeout_clock::time_point timeout) {
_closed = true;
sync();
//FIXME: discarded future.
(void)sync();
return _segment_manager->active_segment(timeout);
}
void reset_sync_time() {
@@ -849,7 +850,8 @@ public:
return new_seg->allocate(id, std::move(writer), std::move(permit), timeout);
});
} else {
cycle().discard_result().handle_exception([] (auto ex) {
//FIXME: discarded future
(void)cycle().discard_result().handle_exception([] (auto ex) {
clogger.error("Failed to flush commits to disk: {}", ex);
});
}
@@ -901,7 +903,8 @@ public:
// then no other request will be allowed in to force the cycle()ing of this buffer. We
// have to do it ourselves.
if ((buffer_position() >= (db::commitlog::segment::default_size))) {
cycle().discard_result().handle_exception([] (auto ex) {
//FIXME: discarded future.
(void)cycle().discard_result().handle_exception([] (auto ex) {
clogger.error("Failed to flush commits to disk: {}", ex);
});
}
@@ -1608,7 +1611,8 @@ void db::commitlog::segment_manager::on_timer() {
// while they are running.
(void)seastar::with_gate(_gate, [this] {
if (cfg.mode != sync_mode::BATCH) {
sync();
//FIXME: discarded future.
(void)sync();
}
// IFF a new segment was put in use since last we checked, and we're
// above threshold, request flush.
@@ -2054,7 +2058,8 @@ db::commitlog::read_log_file(const sstring& filename, const sstring& pfx, seasta
auto w = make_lw_shared<work>(std::move(f), d, read_io_prio_class, off);
auto ret = w->s.listen(next);
w->s.started().then(std::bind(&work::read_file, w.get())).then([w] {
//FIXME: discarded future.
(void)w->s.started().then(std::bind(&work::read_file, w.get())).then([w] {
if (!w->failed) {
w->s.close();
}