Skip to content

Commit

Permalink
rgw: add thread names to RGWRadosThreads
Browse files Browse the repository at this point in the history
Signed-off-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Feb 1, 2017
1 parent fbe24c8 commit 9462afa
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/rgw/rgw_rados.cc
Expand Up @@ -2810,6 +2810,7 @@ class RGWRadosThread {
};

Worker *worker;
const char *thread_name;

protected:
CephContext *cct;
Expand All @@ -2820,7 +2821,8 @@ class RGWRadosThread {
virtual uint64_t interval_msec() = 0;
virtual void stop_process() {}
public:
RGWRadosThread(RGWRados *_store) : worker(NULL), cct(_store->ctx()), store(_store) {}
RGWRadosThread(RGWRados *_store, const char *thread_name = "radosgw")
: worker(NULL), thread_name(thread_name), cct(_store->ctx()), store(_store) {}
virtual ~RGWRadosThread() {
stop();
}
Expand All @@ -2836,7 +2838,7 @@ class RGWRadosThread {
void RGWRadosThread::start()
{
worker = new Worker(cct, this);
worker->create("radosgw");
worker->create(thread_name);
}

void RGWRadosThread::stop()
Expand Down Expand Up @@ -2903,7 +2905,7 @@ class RGWMetaNotifier : public RGWRadosThread {
}
public:
RGWMetaNotifier(RGWRados *_store, RGWMetadataLog* log)
: RGWRadosThread(_store), notify_mgr(_store), log(log) {}
: RGWRadosThread(_store, "meta_notify"), notify_mgr(_store), log(log) {}

int process();
};
Expand Down Expand Up @@ -2934,7 +2936,8 @@ class RGWDataNotifier : public RGWRadosThread {
return cct->_conf->rgw_md_notify_interval_msec;
}
public:
RGWDataNotifier(RGWRados *_store) : RGWRadosThread(_store), notify_mgr(_store) {}
RGWDataNotifier(RGWRados *_store)
: RGWRadosThread(_store, "data_notify"), notify_mgr(_store) {}

int process();
};
Expand Down Expand Up @@ -2964,7 +2967,8 @@ int RGWDataNotifier::process()

class RGWSyncProcessorThread : public RGWRadosThread {
public:
RGWSyncProcessorThread(RGWRados *_store) : RGWRadosThread(_store) {}
RGWSyncProcessorThread(RGWRados *_store, const char *thread_name = "radosgw")
: RGWRadosThread(_store, thread_name) {}
virtual ~RGWSyncProcessorThread() {}
virtual int init() = 0 ;
virtual int process() = 0;
Expand All @@ -2982,7 +2986,7 @@ class RGWMetaSyncProcessorThread : public RGWSyncProcessorThread
}
public:
RGWMetaSyncProcessorThread(RGWRados *_store, RGWAsyncRadosProcessor *async_rados)
: RGWSyncProcessorThread(_store), sync(_store, async_rados) {}
: RGWSyncProcessorThread(_store, "meta_sync"), sync(_store, async_rados) {}

void wakeup_sync_shards(set<int>& shard_ids) {
for (set<int>::iterator iter = shard_ids.begin(); iter != shard_ids.end(); ++iter) {
Expand Down Expand Up @@ -3025,7 +3029,8 @@ class RGWDataSyncProcessorThread : public RGWSyncProcessorThread
public:
RGWDataSyncProcessorThread(RGWRados *_store, RGWAsyncRadosProcessor *async_rados,
const string& _source_zone)
: RGWSyncProcessorThread(_store), sync(_store, async_rados, _source_zone),
: RGWSyncProcessorThread(_store, "data_sync"),
sync(_store, async_rados, _source_zone),
initialized(false) {}

void wakeup_sync_shards(map<int, set<string> >& shard_ids) {
Expand Down Expand Up @@ -3068,7 +3073,7 @@ class RGWSyncLogTrimThread : public RGWSyncProcessorThread
void stop_process() override { crs.stop(); }
public:
RGWSyncLogTrimThread(RGWRados *store, int interval)
: RGWSyncProcessorThread(store),
: RGWSyncProcessorThread(store, "sync_log_trim"),
crs(store->ctx(), store->get_cr_registry()), store(store),
http(store->ctx(), crs.get_completion_mgr()),
trim_interval(interval, 0)
Expand Down

0 comments on commit 9462afa

Please sign in to comment.