diff --git a/compress.cc b/compress.cc index 13fcb8076e..6d8a4ac3e1 100644 --- a/compress.cc +++ b/compress.cc @@ -772,6 +772,8 @@ size_t snappy_processor::uncompress(const char* input, size_t input_len, size_t snappy_processor::compress(const char* input, size_t input_len, char* output, size_t output_len) const { + // FIXME: snappy internally performs allocations greater than 128 kiB. + const memory::scoped_large_allocation_warning_threshold slawt{256*1024}; auto ret = snappy_compress(input, input_len, output, &output_len); if (ret != SNAPPY_OK) { throw std::runtime_error("snappy compression failure: snappy_compress() failed"); diff --git a/transport/server.cc b/transport/server.cc index 4544bdc65f..2d52cad0ff 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -1727,6 +1727,8 @@ void cql_server::response::compress_snappy() auto in = input_buffer.get_linearized_view(_body); size_t output_len = snappy_max_compressed_length(in.size()); _body = output_buffer.make_bytes_ostream(output_len, [&in] (bytes_mutable_view out) { + // FIXME: snappy internally performs allocations greater than 128 kiB. + const memory::scoped_large_allocation_warning_threshold slawt{256*1024}; size_t actual_len = out.size(); if (snappy_compress(reinterpret_cast(in.data()), in.size(), reinterpret_cast(out.data()), &actual_len) != SNAPPY_OK) { throw std::runtime_error("CQL frame Snappy compression failure");