Skip to content

Commit

Permalink
Enhance several sharing tag related error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Oct 27, 2022
1 parent a77f6ea commit 9c3f1d7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions modules/clusterer/sharing_tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ static struct sharing_tag *shtag_get_unsafe(str *tag_name, int c_id)
tag && (tag->cluster_id!=c_id || str_strcmp(&tag->name, tag_name));
tag = tag->next);
if (!tag && !(tag = shtag_create(tag_name, c_id))) {
LM_ERR("Failed to create sharing tag\n");
LM_ERR("Failed to create sharing tag %.*s(%p)\n",
tag_name->len, tag_name->s, tag_name->s);
return NULL;
}

Expand Down Expand Up @@ -407,7 +408,8 @@ static struct sharing_tag *__shtag_get_safe(str *tag_name, int c_id)
if (!tag) {
lock_switch_write(shtags_lock, lock_old_flag);
if ((tag = shtag_create(tag_name, c_id)) == NULL) {
LM_ERR("Failed to create sharing tag\n");
LM_ERR("Failed to create sharing tag %.*s(%p)\n",
tag_name->len, tag_name->s, tag_name->s);
lock_switch_read(shtags_lock, lock_old_flag);
lock_stop_sw_read(shtags_lock);
return NULL;
Expand Down
9 changes: 6 additions & 3 deletions modules/dialog/dlg_db_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ static int load_dialog_info_from_db(int dlg_hash_size)
if (shm_str_dup(&dlg->shtag, &tag_name) < 0)
LM_ERR("No more shm memory\n");
} else if (rc == -1)
LM_ERR("Failed to get dlg value for sharing tag\n");
LM_ERR("Failed to get dlg value for sharing tag %.*s(%p)\n",
tag_name.len, tag_name.s, tag_name.s);

if (dlg_db_mode == DB_MODE_DELAYED) {
/* to be later removed by timer */
Expand Down Expand Up @@ -1469,7 +1470,8 @@ static inline void set_final_update_cols(db_val_t *vals, struct dlg_cell *cell,
/* save sharing tag name as dlg val */
if (cell->shtag.s && store_dlg_value_unsafe(cell, &shtag_dlg_val,
&cell->shtag) < 0)
LM_ERR("Failed to store sharing tag name as dlg val\n");
LM_ERR("Failed to store sharing tag %.*s(%p) as dlg val\n",
cell->shtag.len, cell->shtag.s, cell->shtag.s);

if (on_shutdown || (db_flush_vp && (cell->flags & DLG_FLAG_VP_CHANGED))) {
if (cell->vals==NULL) {
Expand Down Expand Up @@ -1964,7 +1966,8 @@ static int sync_dlg_db_mem(void)
if (shm_str_dup(&dlg->shtag, &tag_name) < 0)
LM_ERR("No more shm memory\n");
} else if (rc == -1)
LM_ERR("Failed to get dlg value for sharing tag\n");
LM_ERR("Failed to get dlg value for sharing tag %.*s(%p)\n",
tag_name.len, tag_name.s, tag_name.s);

if (dlg_db_mode == DB_MODE_DELAYED) {
/* to be later removed by timer */
Expand Down
3 changes: 2 additions & 1 deletion modules/dialog/dlg_repl_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ static inline void remove_local_counter(struct prof_local_count **list,
(shtag->len != cnt->shtag.len || memcmp(shtag->s, cnt->shtag.s, shtag->len));
cnt_prev = cnt, cnt = cnt->next) ;
if (!cnt) {
LM_ERR("Failed to decrement profile counter, shtag not found\n");
LM_ERR("Failed to decrement profile counter, shtag %.*s(%p) not found\n",
shtag->len, shtag->s, shtag->s);
return;
}

Expand Down
6 changes: 4 additions & 2 deletions modules/dialog/dlg_replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ int dlg_replicated_create(bin_packet_t *packet, struct dlg_cell *cell,
if (shm_str_dup(&dlg->shtag, &tag_name) < 0)
LM_ERR("No more shm memory\n");
} else if (rc == -1)
LM_ERR("Failed to get dlg value for sharing tag\n");
LM_ERR("Failed to get dlg value for sharing tag %.*s(%p)\n",
tag_name.len, tag_name.s, tag_name.s);

dlg->locked_by = 0;

Expand Down Expand Up @@ -790,7 +791,8 @@ void bin_push_dlg(bin_packet_t *packet, struct dlg_cell *dlg)

/* save sharing tag name as dlg val */
if (dlg->shtag.s && store_dlg_value_unsafe(dlg, &shtag_dlg_val, &dlg->shtag) < 0)
LM_ERR("Failed to store sharing tag name as dlg val\n");
LM_ERR("Failed to store sharing tag %.*s(%p) as dlg val\n",
dlg->shtag.len, dlg->shtag.s, dlg->shtag.s);

vars = write_dialog_vars(dlg->vals);
profiles = write_dialog_profiles(dlg->profile_links);
Expand Down

0 comments on commit 9c3f1d7

Please sign in to comment.