Skip to content

Commit

Permalink
Merge "This commit makes following change: Set default cassandra conn…
Browse files Browse the repository at this point in the history
…ection timeout in TSocket thrift class to 3 seconds." into R2.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Dec 8, 2014
2 parents 09a2d38 + 2926202 commit 3f639e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gendb/cdb_if.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@ CdbIf::CdbIf(DbErrorHandler errhandler,
task_instance_(-1),
prev_task_instance_(-1),
task_instance_initialized_(false) {

// reduce connection timeout
boost::shared_ptr<TSocket> tsocket =
boost::dynamic_pointer_cast<TSocket>(socket_);
tsocket->setConnTimeout(connectionTimeout);

db_init_done_ = false;
}

Expand Down
2 changes: 2 additions & 0 deletions src/gendb/cdb_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ class CdbIf : public GenDb::GenDbIf {
mutable tbb::mutex smutex_;
CdbIfStats stats_;
std::vector<DbQueueWaterMarkInfo> cdbq_wm_info_;
// Connection timeout to a server (before moving to next server)
static const int connectionTimeout = 3000;
};

CdbIf::CdbIfStats::CfStats operator+(const CdbIf::CdbIfStats::CfStats &a,
Expand Down

0 comments on commit 3f639e4

Please sign in to comment.