Merge pull request #56360 from ClickHouse/add-logs-in-decompressor

Print info while decompressing the binary
This commit is contained in:
Antonio Andelic 2023-11-07 09:36:29 +01:00 committed by GitHub
commit f06d3b29be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ int doDecompress(char * input, char * output, off_t & in_offset, off_t & out_off
std::cerr << "Error (ZSTD):" << decompressed_size << " " << ZSTD_getErrorName(decompressed_size) << std::endl;
return 1;
}
std::cerr << "." << std::flush;
return 0;
}
@ -173,7 +174,7 @@ bool isSudo()
return geteuid() == 0;
}
/// Read data about files and decomrpess them.
/// Read data about files and decompress them.
int decompressFiles(int input_fd, char * path, char * name, bool & have_compressed_analoge, bool & has_exec, char * decompressed_suffix, uint64_t * decompressed_umask)
{
/// Read data about output file.
@ -332,6 +333,8 @@ int decompressFiles(int input_fd, char * path, char * name, bool & have_compress
if (0 != munmap(input, info_in.st_size))
perror("munmap");
std::cerr << std::endl;
return 0;
}
@ -440,6 +443,8 @@ int main(int/* argc*/, char* argv[])
return 1;
}
std::cerr << "Decompressing the binary" << std::flush;
std::stringstream lock_path; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
lock_path << "/tmp/" << name << ".decompression." << inode << ".lock";
int lock = open(lock_path.str().c_str(), O_CREAT | O_RDWR, 0666);