TSG-1518 改进TFE查询Certstore过程的异常处理机制:增加 enable_health_check 配置项
This commit is contained in:
@@ -43,6 +43,9 @@ cert_store_host=192.168.10.8
|
|||||||
cert_store_port=9991
|
cert_store_port=9991
|
||||||
ca_path=resource/tfe/tango-ca-trust-ca.pem
|
ca_path=resource/tfe/tango-ca-trust-ca.pem
|
||||||
untrusted_ca_path=resource/tfe/tango-ca-untrust-ca.pem
|
untrusted_ca_path=resource/tfe/tango-ca-untrust-ca.pem
|
||||||
|
# health_check only for "mode=normal"
|
||||||
|
# default 1
|
||||||
|
enable_health_check=1
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
passthrough_all_tcp=0
|
passthrough_all_tcp=0
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ struct key_keeper
|
|||||||
struct key_keeper_stat stat;
|
struct key_keeper_stat stat;
|
||||||
|
|
||||||
int cert_expire_time;
|
int cert_expire_time;
|
||||||
|
unsigned int enable_health_check;
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -562,6 +563,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo
|
|||||||
MESA_load_profile_string_def(profile, section, "cert_store_host", keeper->cert_store_host,
|
MESA_load_profile_string_def(profile, section, "cert_store_host", keeper->cert_store_host,
|
||||||
sizeof(keeper->cert_store_host), "");
|
sizeof(keeper->cert_store_host), "");
|
||||||
|
|
||||||
|
MESA_load_profile_uint_def(profile, section, "enable_health_check", &(keeper->enable_health_check), 1);
|
||||||
MESA_load_profile_uint_def(profile, section, "cert_store_port", &(keeper->cert_store_port), 80);
|
MESA_load_profile_uint_def(profile, section, "cert_store_port", &(keeper->cert_store_port), 80);
|
||||||
MESA_load_profile_uint_def(profile, section, "hash_slot_size", &(keeper->hash_slot_size), 1024*128);
|
MESA_load_profile_uint_def(profile, section, "hash_slot_size", &(keeper->hash_slot_size), 1024*128);
|
||||||
MESA_load_profile_uint_def(profile, section, "hash_expire_seconds", &(keeper->hash_expire_seconds), 5*60);
|
MESA_load_profile_uint_def(profile, section, "hash_expire_seconds", &(keeper->hash_expire_seconds), 5*60);
|
||||||
@@ -595,7 +597,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// KK_MODE_CERT_STORE: create thread for certstore health check
|
// KK_MODE_CERT_STORE: create thread for certstore health check
|
||||||
else
|
if (keeper->work_mode == KK_MODE_CERT_STORE && keeper->enable_health_check)
|
||||||
{
|
{
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
|
|||||||
Reference in New Issue
Block a user