Merge pull request #20281 from ClickHouse/aku/fuzzer-changed-settings

print changed settings in fuzzer when the server dies
This commit is contained in:
alexey-milovidov 2021-02-11 03:26:01 +03:00 committed by GitHub
commit 8553a65ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1374,7 +1374,30 @@ private:
{
// Probably the server is dead because we found an assertion
// failure. Fail fast.
fmt::print(stderr, "Lost connection to the server\n");
fmt::print(stderr, "Lost connection to the server.\n");
// Print the changed settings because they might be needed to
// reproduce the error.
const auto & changes = context.getSettingsRef().changes();
if (!changes.empty())
{
fmt::print(stderr, "Changed settings: ");
for (size_t i = 0; i < changes.size(); ++i)
{
if (i)
{
fmt::print(stderr, ", ");
}
fmt::print(stderr, "{} = '{}'", changes[i].name,
toString(changes[i].value));
}
fmt::print(stderr, "\n");
}
else
{
fmt::print(stderr, "No changed settings.\n");
}
return false;
}