Skip to content

Commit

Permalink
logging: complete fix in commit a4bf044
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu committed Jun 9, 2023
1 parent 91c264a commit 1e5fbec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
12 changes: 5 additions & 7 deletions modules/event_kafka/kafka_producer.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,21 +637,14 @@ static int handle_io(struct fd_map *fm, int idx, int event_type)

switch (fm->type) {
case F_KAFKA_JOB:
/* suppress the E_CORE_LOG event for new logs while handling
* the event itself */
suppress_proc_log_event();

job = kafka_receive_job();
if (!job) {
LM_ERR("Cannot receive job\n");
reset_proc_log_event();
return 0;
}

if (kafka_handle_job(job) != 0)
shm_free(job);

reset_proc_log_event();
break;
case F_KAFKA_EVENT:
prod = (kafka_producer_t *)fm->data;
Expand Down Expand Up @@ -679,6 +672,10 @@ static int handle_io(struct fd_map *fm, int idx, int event_type)

void kafka_process(int rank)
{
/* suppress the E_CORE_LOG event for new logs while handling
* the event itself */
suppress_proc_log_event();

signal(SIGTERM, sig_handler);

if (init_worker_reactor("Kafka worker", RCT_PRIO_MAX) != 0) {
Expand All @@ -697,5 +694,6 @@ void kafka_process(int rank)

out_err:
destroy_io_wait(&_worker_io);
reset_proc_log_event();
abort();
}
11 changes: 4 additions & 7 deletions modules/event_stream/stream_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,20 +661,13 @@ static int handle_io(struct fd_map *fm, int idx, int event_type)

switch (fm->type) {
case F_EV_JSONRPC_CMD:
/* suppress the E_CORE_LOG event for new logs while handling
* the event itself */
suppress_proc_log_event();

jsonrpcs = stream_receive();
if (!jsonrpcs) {
LM_ERR("invalid receive jsonrpc command\n");
reset_proc_log_event();
return -1;
}

handle_new_stream(jsonrpcs);

reset_proc_log_event();
break;
case F_EV_JSONRPC_RPL:
con = (struct stream_con *)fm->data;
Expand Down Expand Up @@ -716,6 +709,9 @@ static void stream_cleanup_old(void)

void stream_process(int rank)
{
/* suppress the E_CORE_LOG event for new logs while handling
* the event itself */
suppress_proc_log_event();

if (init_worker_reactor("event_stream Sender", RCT_PRIO_MAX) != 0) {
LM_BUG("failed to init event_stream reactor");
Expand All @@ -732,5 +728,6 @@ void stream_process(int rank)

out_err:
destroy_io_wait(&_worker_io);
reset_proc_log_event();
abort();
}

0 comments on commit 1e5fbec

Please sign in to comment.