Skip to content

dialog: release locks on all error paths - #4528

Open
vladpaiu wants to merge 1 commit into
OpenSIPS:masterfrom
vladpaiu:fix_dialog_locking
Open

vladpaiu wants to merge 1 commit into
OpenSIPS:masterfrom
vladpaiu:fix_dialog_locking

Conversation

@vladpaiu

@vladpaiu vladpaiu commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary
Currently there were several dialog module bugs related to locking, which could potentially causes deadlocks in certain scenarios.

Details

  • dlg_get_json_out(): release vals_lock when the 32 KB JSON buffer is exhausted (get_dialogs_by_profile/by_val left a reader behind, causing the dlg-dbupdate timer to block holding the hash bucket lock)
  • check_dlg_value(): release vals_lock on integer/boolean match
  • internal_mi_print_dlg(): release vals_lock when adding an int or bool dialog value fails
  • mi_match_print_dlg(): release the bucket lock if result alloc fails
  • dlg_onreq_out(): do not release a bucket lock that was never taken

Solution
Release locks on all error cases.

- dlg_get_json_out(): release vals_lock when the 32 KB JSON buffer is
  exhausted (get_dialogs_by_profile/by_val left a reader behind, causing
  the dlg-dbupdate timer to block holding the hash bucket lock)
- check_dlg_value(): release vals_lock on integer/boolean match
- internal_mi_print_dlg(): release vals_lock when adding an int or
  bool dialog value fails
- mi_match_print_dlg(): release the bucket lock if result alloc fails
- dlg_onreq_out(): do not release a bucket lock that was never taken
@vladpaiu vladpaiu added the bug label Dec 3, 2026
@vladpaiu vladpaiu modified the milestones: 3.6.11, 4.0.4 Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant