Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix set thread name fail with string more than 16 byte. #496

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/redis_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4159,7 +4159,7 @@ class CommandFetchMeta : public Commander {

// Feed-replica-meta thread
std::thread t = std::thread([svr, repl_fd, ip]() {
Util::ThreadSetName("feed-replica-data-info");
Util::ThreadSetName("feed-repl-info");
std::string files;
auto s = Engine::Storage::ReplDataManager::GetFullReplDataInfo(
svr->storage_, &files);
Expand Down Expand Up @@ -4206,7 +4206,7 @@ class CommandFetchFile : public Commander {
conn->EnableFlag(Redis::Connection::kCloseAsync);

std::thread t = std::thread([svr, repl_fd, ip, files]() {
Util::ThreadSetName("feed-replica-file");
Util::ThreadSetName("feed-repl-file");
svr->IncrFetchFileThread();

for (auto file : files) {
Expand Down
2 changes: 1 addition & 1 deletion src/replication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FeedSlaveThread::~FeedSlaveThread() {
Status FeedSlaveThread::Start() {
try {
t_ = std::thread([this]() {
Util::ThreadSetName("feed-slave-thread");
Util::ThreadSetName("feed-replica");
sigset_t mask, omask;
sigemptyset(&mask);
sigemptyset(&omask);
Expand Down
2 changes: 1 addition & 1 deletion src/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Status Server::Start() {
compaction_checker_thread_ = std::thread([this]() {
uint64_t counter = 0;
int32_t last_compact_date = 0;
Util::ThreadSetName("compaction-checker");
Util::ThreadSetName("compact-check");
CompactionChecker compaction_checker(this->storage_);
while (!stop_) {
// Sleep first
Expand Down
2 changes: 1 addition & 1 deletion src/slot_migrate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Status SlotMigrate::MigrateStart(Server *svr, const std::string &node_id, const
Status SlotMigrate::CreateMigrateHandleThread(void) {
try {
t_ = std::thread([this]() {
Util::ThreadSetName("slotmigrate-task");
Util::ThreadSetName("slot-migrate");
this->Loop(static_cast<void*>(this));
});
} catch(const std::exception &e) {
Expand Down