system_keyspace/config: Swallow string->value cast exception

When updating an updateable value via CQL the new value comes as a
string that's then boost::lexical_cast-ed to the desired value. If the
cast throws the respective exception is printed in logs which is very
likely uncalled for.

fixes: #10394
tests: manual

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
Message-Id: <20220503142942.8145-1-xemul@scylladb.com>
(cherry picked from commit 063d26bc9e)
This commit is contained in:
Pavel Emelyanov
2022-05-03 17:29:42 +03:00
committed by Avi Kivity
parent 50c2c1b1d4
commit d3b3c53d9f

View File

@@ -2482,10 +2482,14 @@ class db_config_table final : public streaming_virtual_table {
for (auto& c_ref : cfg.values()) {
auto& c = c_ref.get();
if (c.name() == name) {
if (c.set_value(value, utils::config_file::config_source::CQL)) {
return cfg.broadcast_to_all_shards();
} else {
return make_exception_future<>(virtual_table_update_exception("option is not live-updateable"));
try {
if (c.set_value(value, utils::config_file::config_source::CQL)) {
return cfg.broadcast_to_all_shards();
} else {
return make_exception_future<>(virtual_table_update_exception("option is not live-updateable"));
}
} catch (boost::bad_lexical_cast&) {
return make_exception_future<>(virtual_table_update_exception("cannot parse option value"));
}
}
}