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

refine object free #99

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
728bde0
1)Changing: modify qconf test
CatKang Aug 7, 2015
14578d3
1)Changing:modify agent/CMakeList
CatKang Aug 7, 2015
5bbf17b
Update nginx_template.sh
CatKang Aug 8, 2015
db3be7e
1)Changing:modify integration test script
CatKang Aug 26, 2015
33b203f
1)Changing: change integrate test
CatKang Aug 28, 2015
2687c3b
1)Changing: fix get_batch_conf leak bug
CatKang Sep 7, 2015
4b06b84
1)Changing: fix bug for gray node when reconnection happened
CatKang Sep 25, 2015
1f53450
1)Changing: add retry operateion when create ephemeral node
CatKang Sep 28, 2015
d68903a
1)Deleting: remove useless file
CatKang Sep 28, 2015
8946381
Update README.md
CatKang Sep 29, 2015
16fdab7
1)Changing: disable librtmp from libcurl
CatKang Sep 30, 2015
0eaad93
1)Changing: add${GDBM_SOURCE_DIR}/include
CatKang Oct 8, 2015
75011ec
1)Changing: add link for zkdash in document
CatKang Oct 15, 2015
c11630c
add node-qconf doc
Oct 29, 2015
8e6261f
Merge pull request #19 from bluedapp/master
CatKang Oct 29, 2015
38fd505
Fix bug of agent restart
CatKang Nov 24, 2015
a2a56c3
Fix problem in qhasharr
CatKang Nov 27, 2015
de75650
Add support for PHP 7.0.0
monque Dec 15, 2015
ec335f0
Merge pull request #24 from monque/master
CatKang Dec 16, 2015
42b31ce
Update README.md
CatKang Feb 26, 2016
3038768
Update README_ZH.md
CatKang Feb 26, 2016
b4e2dbb
Resolve agent stop failed since the block msgrcv
CatKang May 21, 2016
90e1f5e
Resolve problem for failing to register ephermeral nodes when stopres…
CatKang May 21, 2016
67d3ad7
improve get_conf() performance in luajit
monque Jun 8, 2016
9eaf9de
Merge pull request #31 from monque/getconf-improve
CatKang Jun 8, 2016
449066c
Fixd segmentation fault for in the case gcc 4.8 and php7
cdoco Jun 27, 2016
831cab5
Merge pull request #34 from cdoco/master
CatKang Jun 28, 2016
eeec8a0
fix segmentation fault when idc is default
Jul 25, 2016
15b7c20
Merge pull request #38 from akinzhou100/idc-default-segmentation-fault
CatKang Jul 29, 2016
d7c67dc
Compatible with python3
bale-john Aug 1, 2016
53d83ea
Compatible with python3
bale-john Aug 1, 2016
e8160ef
change the shared memory to persudo LRU memory
bale-john Aug 10, 2016
65057c6
Merge branch 'master' of github.com:Qihoo360/QConf
bale-john Aug 15, 2016
04213b8
add interface for node.js
bale-john Aug 15, 2016
a224e8c
Merge branch 'master' of github.com:Qihoo360/QConf
bale-john Aug 15, 2016
3ee4da3
add README
bale-john Aug 15, 2016
9edcf0a
copy qconf.node to install dir of qconf
bale-john Aug 15, 2016
9a41b2c
keep consistency of lruMem and shared memory
bale-john Aug 16, 2016
4033611
if init lru memory, just break out
bale-john Aug 16, 2016
ba7f421
make the size of shared memory configurable
bale-john Aug 16, 2016
6928b9b
avoid adding localIDC info to lru memory
bale-john Aug 16, 2016
984b33a
Merge branch 'master' of github.com:Qihoo360/QConf
bale-john Aug 16, 2016
294ba0f
Merge branch 'LRUMem'
bale-john Aug 16, 2016
25a160c
fix bugs and add qconf_init()
bale-john Aug 19, 2016
d44e3b7
add compiler option '-O2' to optimize md5 calculation
Oct 26, 2016
d6e4b16
Merge pull request #46 from gaodq/master
CatKang Oct 31, 2016
4c4337a
make value verification simpler and faster
Nov 1, 2016
a3c7ff9
1) idc configuration support domain name; 2) remove unused variable; …
Nov 7, 2016
ef28cc9
remove repeated function
CatKang Nov 15, 2016
5d03a68
check tblsize and value size in advance
Nov 16, 2016
69c9074
change value size and type to macro
Nov 16, 2016
f47540e
Merge branch 'dev', add new verification function.
Nov 17, 2016
c273ac1
add qconf monitor
Nov 21, 2016
f37c8d7
add submodules
Nov 22, 2016
43501af
1) optimize monitor.cc; 2) format code.
Nov 22, 2016
c6ee2e1
modify Config with slash::BaseConf
Nov 23, 2016
8dd46cd
implement Thread with pink
Nov 25, 2016
dcbc045
make MonitorZK as abstract class
Nov 30, 2016
6075b68
simplify the code
Dec 2, 2016
ca015da
bugfix: solve chaos of multi monitors
Dec 6, 2016
c7e4765
uniform code style
Dec 7, 2016
ea215d0
use slash instead of util
Dec 7, 2016
bde855a
Update README.md
baotiao Dec 7, 2016
369d13a
Update README_ZH.md
baotiao Dec 7, 2016
7c59050
use int as operation sign
Dec 9, 2016
c060bdb
adjust constucture
Jan 5, 2017
0c1b92d
optimize get own sequence
Jan 6, 2017
1ed35b9
Use PinkCli to detect server
Jan 6, 2017
16af9fe
optimize const define
Jan 6, 2017
f49603c
update code
Jan 6, 2017
ba8b535
trim code
Jan 6, 2017
8ec7eda
Update and rename README to README.md
Jan 11, 2017
20806e9
Add .travis.yml
Jan 12, 2017
a030def
Use mixed verification code as default.
Jan 12, 2017
1abb829
Update version
Jan 12, 2017
6f9b00c
bugfix of memory leak; update version number
Feb 9, 2017
21d87c2
bugfix: init has_thread vector
Feb 9, 2017
1a761ad
bugfix: delete pink cli in deconstructor
Feb 10, 2017
af06d67
Merge branch 'monitor'
Feb 10, 2017
4dcef1d
Fixed compile error in some os (like alpine)
Kinping-Tse Feb 14, 2017
501a3da
Merge pull request #54 from Kinping-Tse/master
Feb 14, 2017
4cf69d3
change shared memory key
Feb 14, 2017
dee0618
protect hashtable in memory
Mar 22, 2017
324df1e
Reduce the space occupied by gdbm dumps
Mar 30, 2017
2a2b2c8
Ensure the correctness during receiving data from zk
Mar 31, 2017
638ec06
Update version number
Apr 7, 2017
b72fc55
Bugfix of check pending node
Apr 7, 2017
9463ad5
Update README.md
May 18, 2017
4131bed
Update README.md
May 18, 2017
fcd54cd
Update README.md
May 18, 2017
e6e5ac4
modify gray thread info
CatKang May 25, 2017
be52133
bug
gcliupeng May 27, 2017
58b05c0
Merge pull request #69 from gcliupeng/master
Jun 13, 2017
96f44fa
QConf manager support PHP 7, resolved #73
Jun 28, 2017
2e61e90
Fix unit tests
Jun 29, 2017
8a2ed67
Always use system libtool
Jul 6, 2017
3930784
add QConfZK::grayContent func
zzorrow Jul 7, 2017
050e100
grayContent add methods
zzorrow Jul 7, 2017
48cbbd9
Fix qconf_zk.h make error
zzorrow Jul 7, 2017
e7ac9e7
PHP5 add grayContent func
zzorrow Jul 10, 2017
74f9cec
add grayContent func
zzorrow Jul 10, 2017
fd8efcd
fix confilct
zzorrow Jul 10, 2017
72704ca
还原deps
zzorrow Jul 10, 2017
bcc91ee
fix php5 grayContent bug
zzorrow Jul 11, 2017
cb544c6
Merge pull request #76 from wangwenbo/master
Jul 11, 2017
8df0f15
Convert to UNIX format
Jul 20, 2017
e229363
Support localidc command line argument
Jul 20, 2017
ce13ea9
Use our own libtool
Jul 20, 2017
b47947c
Bugfix of qconf_agent main
Jul 20, 2017
7d9ee42
Internal version support php7 driver
Jul 28, 2017
2069e42
Update version to v1.2.2
Jul 28, 2017
217c801
correct the mistake to set the timeout.tv_usec
cothee Sep 11, 2017
fb7907d
Merge pull request #84 from cothee/master
Sep 11, 2017
e3890ce
Fix uninitialize variable in qconf_config.cc
Jan 24, 2018
f629087
change one annotation
zhoutong12589 Jun 27, 2018
a73c9db
Merge pull request #97 from zhoutong12589/master
Jun 28, 2018
ba297bc
refine object free
Aug 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.swp
*lockfile
*.out
**tags
manager/deps/*
deps/*
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "monitor/third/pink"]
path = monitor/third/pink
url = https://github.com/Qihoo360/pink.git
[submodule "monitor/third/slash"]
path = monitor/third/slash
url = https://github.com/baotiao/slash.git
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: required
dist: trusty
language: cpp

os:
- linux

compiler:
- gcc

language: cpp
notifications:
email:
- [email protected]

script:
- cmake .
- make
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
QConf
=====

[![Build Status](https://travis-ci.org/Qihoo360/QConf.svg?branch=master)](https://travis-ci.org/Qihoo360/QConf)

We have build another interesting proect [pika](https://github.com/Qihoo360/pika). Pika is a nosql compatible with redis protocol with huge storage space. You can have a try.

## Introduction [中文](https://github.com/Qihoo360/QConf/blob/master/README_ZH.md)
QConf is a Distrubuted Configuration Management System!

QConf is a Distributed Configuration Management System!
A better replacement of the traditional configuration file. As designed, configuration items which is constantly accessed and modified should be completely separated with application code, and QConf is where it should be.

## Features
* Changes to any configuration will be synchronised to all client machines in real-time.
* High query efficiency.
* Convenient deployment and simple interface.
* High robustness and fault-tolerance.
* support c/c++, shell, php, python, lua, java, go and etc.
* support c/c++, shell, php, python, lua, java, go, node and etc.

## Install
The QConf is built using CMake (version 2.6 or newer).
Expand Down Expand Up @@ -58,6 +63,10 @@ cd QCONF_INSTALL_PREFIX/bin && sh agent-cmd.sh start
- **Code** to access QConf


## Related
* [zkdash](https://github.com/ireaderlab/zkdash) - An excellent dashboard for QConf or ZooKeeper provided by IReader Team


## Performance
1. statergy
* **running times** : ten million times altogether
Expand Down Expand Up @@ -95,6 +104,7 @@ cd QCONF_INSTALL_PREFIX/bin && sh agent-cmd.sh start

## Document
* [Getting Started](https://github.com/Qihoo360/QConf/blob/master/doc/QConf%20Getting%20Started%20Guide.md) - a tutorial-style guide for developers to install, run, and program to QConf
* [Implement](http://catkang.github.io/2015/06/23/qconf.html)
* [wiki](https://github.com/Qihoo360/QConf/wiki)
* [qconf video guide](https://github.com/Qihoo360/QConf/wiki/QConf-%E7%AE%80%E6%98%93%E9%83%A8%E7%BD%B2%E5%92%8C%E4%BD%BF%E7%94%A8)

Expand Down
7 changes: 6 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
QConf
=====

我们团队开发了另外一个有意思的项目 [pika](https://github.com/Qihoo360/pika), pika 是一个兼容redis 协议的大容量的存储, 用来解决redis 内存不够的问题, 欢迎大家试试

## 简介 [English](https://github.com/Qihoo360/QConf/blob/master/README.md)
QConf 是一个分布式配置管理工具。
用来替代传统的配置文件,使得配置信息和程序代码分离,同时配置变化能够实时同步到客户端,而且保证用户高效读取配置,这使的工程师从琐碎的配置修改、代码提交、配置上线流程中解放出来,极大地简化了配置管理工作。
Expand All @@ -10,7 +12,7 @@ QConf 是一个分布式配置管理工具。
* 高效读取配置
* 安装部署方便,使用简单
* 服务器宕机、网络中断、集群迁移等异常情况对用户透明
* 支持c/c++、shell、php、python、lua、java、go 等语言
* 支持c/c++、shell、php、python、lua、java、go、node 等语言


## 编译安装
Expand Down Expand Up @@ -57,6 +59,8 @@ cd QCONF_INSTALL_PREFIX/bin && sh agent-cmd.sh start
```
- 编写代码访问QConf

## 相关
* [zkdash](https://github.com/ireaderlab/zkdash) - 由掌阅团队开发的dashboad平台,可以作为QConf或ZooKeeper的管理端

## 性能
1. 测试策略
Expand Down Expand Up @@ -95,6 +99,7 @@ cd QCONF_INSTALL_PREFIX/bin && sh agent-cmd.sh start

## 文档
* [Getting Started](https://github.com/Qihoo360/QConf/blob/master/doc/QConf%20Getting%20Started%20Guide.md) - QConf 使用说明,包括QConf的安装,运行,API等信息
* [实现介绍](http://catkang.github.io/2015/06/23/qconf.html)
* [wiki](https://github.com/Qihoo360/QConf/wiki)
* [qconf video guide](https://github.com/Qihoo360/QConf/wiki/QConf-%E7%AE%80%E6%98%93%E9%83%A8%E7%BD%B2%E5%92%8C%E4%BD%BF%E7%94%A8)

Expand Down
7 changes: 1 addition & 6 deletions agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,9 @@ set_source_files_properties(../base/qlibc/md5.c PROPERTIES LANGUAGE CXX )
set_source_files_properties(../base/qlibc/qhash.c PROPERTIES LANGUAGE CXX )
set_source_files_properties(../base/qlibc/qhasharr.c PROPERTIES LANGUAGE CXX )

#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AGENT_COMPILE_FLAGS}" )
#set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINK_FLAGS}" )

add_definitions(${AGENT_COMPILE_FLAGS})
add_executable(qconf_agent ${DIR_SRCS})

#execute_process(COMMAND echo "cmake install prefix : "${CMAKE_INSTALL_PREFIX})

# link libpthread
find_package (Threads)
target_link_libraries (qconf_agent ${CMAKE_THREAD_LIBS_INIT})
Expand All @@ -51,7 +46,7 @@ ENDIF(WIN32)
#build libcurl
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../deps/curl COMMAND ./configure
--prefix=${PROJECT_SOURCE_DIR}/../deps/curl/_install --disable-ldap
--disable-ldaps --without-ssl --without-zlib --without-libidn)
--disable-ldaps --without-ssl --without-zlib --without-libidn --without-librtmp)
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../deps/curl COMMAND
make)
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../deps/curl COMMAND
Expand Down
4 changes: 2 additions & 2 deletions agent/bin/agent-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ start () {

stop () {
chk_agent_exist
#kill $chdpid
killall -9 $agentpath
kill $chdpid
#killall -9 $agentpath
echo "$agent stop."
}

Expand Down
3 changes: 3 additions & 0 deletions agent/conf/agent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ feedback_enable=0

# feedback url
#feedback_url=feedback_server:8360/feedback

# size of lru memory
shared_memory_size=100000
42 changes: 36 additions & 6 deletions agent/qconf_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

using namespace std;

extern int maxSlotsNum;
const string QCONF_PID_FILE("/pid");
const string QCONF_LOG_FMT("/logs/qconf.log.%Y-%m-%d-%H");

Expand All @@ -31,14 +32,20 @@ static void qconf_agent_destroy();
#define STRING_(str) #str
#define STRING(str) STRING_(str)

int main(int argc, char **arg)
static void Usage() {
LOG_INFO("Usage: \n ./qconf_agent --localidc=idcname\n"
"We support one argument for now, idcname is "
"your idc name in agent.conf");
}

int main(int argc, char* argv[])
{
string agent_dir("..");
#ifdef QCONF_AGENT_DIR
agent_dir = STRING(QCONF_AGENT_DIR);
#endif

qconf_set_log_level(QCONF_LOG_ERR);
qconf_set_log_level(QCONF_LOG_INFO);
LOG_INFO("agent_dir:%s", agent_dir.c_str());

// check whether agent is running
Expand All @@ -48,7 +55,22 @@ int main(int argc, char **arg)
if (QCONF_OK != ret) return ret;

// load configure
ret = qconf_load_conf(agent_dir);
// Check localidc argv
std::string localidc;
if (argc > 1) {
if (argc == 2) {
std::string localidc_s(argv[1]);
if (localidc_s.empty()) {
Usage();
}
size_t pos = localidc_s.find("=");
localidc.assign(localidc_s.substr(pos + 1));
} else {
Usage();
}
LOG_INFO("localidc: %s", localidc.c_str());
}
ret = qconf_load_conf(agent_dir, localidc);
if (QCONF_OK != ret)
{
LOG_FATAL_ERR("Failed to load configure!");
Expand Down Expand Up @@ -97,13 +119,20 @@ int main(int argc, char **arg)
signal(SIGUSR2, sig_handler);

// Environment initialize
ret = get_agent_conf(SHARED_MEMORY_SIZE, value);
if (ret == QCONF_OK) {
maxSlotsNum = atoi(value.c_str());
}
else {
maxSlotsNum = QCONF_MAX_SLOTS_NUM;
}

ret = qconf_agent_init(agent_dir, log_dir);
if (QCONF_OK != ret)
{
LOG_ERR("Failed to init qconf agent!");
return ret;
}

// main
watcher_setting_start();

Expand Down Expand Up @@ -241,8 +270,9 @@ static void sig_handler(int sig)
case SIGTERM:
case SIGUSR2:
qconf_thread_exit();
qconf_agent_destroy();
exit(0);
//qconf_agent_destroy();
//exit(0);
break;
case SIGHUP:
break;
case SIGUSR1:
Expand Down
1 change: 1 addition & 0 deletions agent/qconf_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <dirent.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/ipc.h>

#include <vector>

Expand Down
Loading