Apache License 2.0
citahub / cita-forever Goto Github PK
View Code? Open in Web Editor NEWGuarding CITA is running all the time
Home Page: https://github.com/cryptape/cita
License: Apache License 2.0
Guarding CITA is running all the time
Home Page: https://github.com/cryptape/cita
License: Apache License 2.0
启动微服务出错场景:
.pid
文件;.pid
文件中 pid 号相同的进程已经在执行;以上场景会导致微服务启动失败,出错信息为:
WARN - cita-network already started, pid is 5617
其实这时,微服务是没有启动的。
见:
https://talk.citahub.com/t/topic/523/5
citahub/cita#407
更多信息:
程序在 check_process
中处理逻辑不正确。
// whether process exsit
fn check_process(pidfile: String) -> Option<u32> {
// read pid from pidfile
let pid: u32 = read_pid(pidfile);
if pid == 0 {
None
} else {
let pid_str = pid.to_string();
let args = vec!["-p", &pid_str, "-o", "pid="];
let output = Command::new("ps")
.args(args)
.output()
.expect("failed to execute ps -p");
if output.status.success() {
let otpt_str = String::from_utf8(output.stdout).unwrap();
if otpt_str.contains(&pid.to_string()) {
Some(pid)
} else {
None
}
} else {
None
}
}
}
程序需要检查 pid 号外,还需检查微服务名是否一致,才能判定微服务已经启动。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.