Compare commits

...
10 Commits
Author SHA1 Message Date
fengzeroz cc86ffd497 Merge pull request #1105 from fengzeroz/v2.3
version: 2.3.8
2023-03-10 10:26:29 +08:00
fengzero f32188e3c1 version: 2.3.8 2023-03-10 02:25:44 +00:00
fengzeroz 93af6bfe76 Merge pull request #1104 from fengzeroz/v2.3
fix(event): handle EINTR
2023-03-10 10:23:31 +08:00
fengzero 5c543e0077 fix(event): handle EINTR 2023-03-10 02:17:54 +00:00
fengzeroz f6c591e951 Merge pull request #1101 from lixiumei123/v2.3
fix download log file
2023-03-08 14:47:09 +08:00
liyuxi eb332bd745 fix download log file 2023-03-08 05:55:03 +00:00
fengzeroz d026d1f754 Merge pull request #1096 from fengzeroz/v2.3
chore(main): handle SIGSEGV signal
2023-03-07 13:24:43 +08:00
fengzero fd6c3aca96 chore(main): handle SIGSEGV signal 2023-03-07 05:20:55 +00:00
fengzeroz faee3ab68c Merge pull request #1093 from fengzeroz/v2.3
fix(connection): disconnect if recv return 0
2023-03-07 11:42:14 +08:00
fengzero 68587420e0 fix(connection): disconnect if recv return 0 2023-03-07 03:23:30 +00:00
6 changed files with 27 additions and 46 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ on:
- published
env:
VERSION: 2.3.7
UI_VERSION: 2.3.6
VERSION: 2.3.8
UI_VERSION: 2.3.7
BRANCH: v2.3
jobs:
+16 -42
View File
@@ -58,43 +58,27 @@ void handle_logs_files(nng_aio *aio)
VALIDATE_JWT(aio);
rv = mkdir("neuron_logs", S_IRWXU);
if (0 != rv && EEXIST == errno) {
rv = 0;
}
// check if coredump exists
rv = access("./core", F_OK);
if (0 == rv) {
rv = system("cp -r ./core neuron_logs");
if (0 != rv) {
nlog_error("failed to copy coredump file");
NEU_JSON_RESPONSE_ERROR(NEU_ERR_COMMAND_EXECUTION_FAILED, {
http_response(aio, error_code.error, result_error);
});
return;
}
}
rv = system("cp -r ./logs neuron_logs");
/* check whether the neuron directory exists */
rv = access("../neuron", F_OK);
if (0 != rv) {
nlog_error("failed to copy logs file");
nlog_error("The neuron directory does not exists");
NEU_JSON_RESPONSE_ERROR(NEU_ERR_FILE_NOT_EXIST, {
http_response(aio, error_code.error, result_error);
});
return;
}
/* tar the neuron directory */
rv = system("tar -zcvf neuron_debug.tar.gz ../neuron");
if (0 != rv) {
nlog_error("failed to create neuron_debug.tar.gz");
NEU_JSON_RESPONSE_ERROR(NEU_ERR_COMMAND_EXECUTION_FAILED, {
http_response(aio, error_code.error, result_error);
});
return;
}
rv = system("tar -zcvf neuron_logs.tar.gz neuron_logs");
if (0 != rv) {
nlog_error("failed to create neuron_logs.tar.gz");
NEU_JSON_RESPONSE_ERROR(NEU_ERR_COMMAND_EXECUTION_FAILED, {
http_response(aio, error_code.error, result_error);
});
return;
}
strcpy(path, "neuron_logs.tar.gz");
strcpy(path, "neuron_debug.tar.gz");
rv = read_file(path, &data, &len);
if (0 != rv) {
NEU_JSON_RESPONSE_ERROR(
@@ -102,18 +86,8 @@ void handle_logs_files(nng_aio *aio)
return;
}
// delete neuron_logs folder from build
rv = system("rm -rf neuron_logs.tar.gz neuron_logs");
if (0 != rv) {
nlog_error("failed to delete neuron_logs folder");
NEU_JSON_RESPONSE_ERROR(NEU_ERR_COMMAND_EXECUTION_FAILED, {
http_response(aio, error_code.error, result_error);
});
return;
}
// handle http response
strcpy(disp, "attachment; filename=neuron_logs.tar.gz");
/* handle http response */
strcpy(disp, "attachment; filename=neuron_debug.tar.gz");
rv = http_resp_files(aio, data, len, disp);
if (0 != rv) {
return;
+1 -1
View File
@@ -389,7 +389,7 @@ ssize_t neu_conn_recv(neu_conn_t *conn, uint8_t *buf, ssize_t len)
conn->fd, len, ret, strerror(errno), errno);
}
if (errno == EPIPE || ret == -1) {
if (errno == EPIPE || ret == -1 || ret == 0) {
conn_disconnect(conn);
}
+5
View File
@@ -88,6 +88,11 @@ static void *event_loop(void *arg)
if (ret == 0) {
continue;
}
if (ret == -1 && errno == EINTR) {
continue;
}
if (ret == -1 || events->stop) {
zlog_warn(neuron, "event loop exit, errno: %s(%d), stop: %d",
strerror(errno), errno, events->stop);
+2
View File
@@ -48,6 +48,7 @@ static void sig_handler(int sig)
}
zlog_fini();
exit_flag = true;
exit(-1);
}
static int neuron_run(const neu_cli_args_t *args)
@@ -58,6 +59,7 @@ static int neuron_run(const neu_cli_args_t *args)
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);
signal(SIGABRT, sig_handler);
signal(SIGSEGV, sig_handler);
// try to enable core dump
rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
+1 -1
View File
@@ -1 +1 @@
2.3.7
2.3.8