diff --git a/debian/patches/series b/debian/patches/series index 7c0bdf6c1..87cd88f8f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -46,6 +46,7 @@ upstream/usrloc-remove-destroy-of-internal-structures-on-mod-.patch upstream/htable-remove-destroy-of-internal-structures-on-mod-.patch upstream/presence-remove-destroy-of-internal-structures-on-mo.patch upstream/pua-remove-destroy-of-internal-structures-on-mod-des.patch +upstream/tm_drop_stuck_transaction.patch ### relevant for upstream sipwise/dialplan-don-t-stop-loading-rules-on-error.patch sipwise/kamctl-TMPDIR-config.patch diff --git a/debian/patches/upstream/tm_drop_stuck_transaction.patch b/debian/patches/upstream/tm_drop_stuck_transaction.patch new file mode 100644 index 000000000..6e7cbadf2 --- /dev/null +++ b/debian/patches/upstream/tm_drop_stuck_transaction.patch @@ -0,0 +1,32 @@ +--- a/src/modules/tm/t_lookup.c ++++ b/src/modules/tm/t_lookup.c +@@ -2057,7 +2057,7 @@ int t_unref(struct sip_msg *p_msg) + return -1; + if(p_msg->first_line.type == SIP_REQUEST) { + kr = get_kr(); +- if(unlikely(kr == REQ_ERR_DELAYED)) { ++ if(unlikely(kr & REQ_ERR_DELAYED)) { + LM_DBG("delayed error reply generation(%d)\n", tm_error); + if(unlikely(is_route_type(FAILURE_ROUTE))) { + LM_BUG("called w/ kr=REQ_ERR_DELAYED in failure" +@@ -2074,15 +2074,12 @@ int t_unref(struct sip_msg *p_msg) + && !(kr & REQ_RLSD)))) { + LM_WARN("script writer didn't release transaction\n"); + t_release_transaction(T); +- } else if(unlikely((kr & REQ_ERR_DELAYED) +- && (kr +- & ~(REQ_RLSD | REQ_RPLD | REQ_ERR_DELAYED +- | REQ_FWDED)))) { +- LM_BUG("REQ_ERR DELAYED should have been caught much" +- " earlier for %p: %d (hex %x)\n", +- T, kr, kr); ++ } else if(unlikely(T->nr_of_outgoings == 0 ++ && !(T->flags & T_IN_AGONY))) { ++ LM_WARN("dropping orphaned transaction without branches" ++ " T=%p kr=%d\n", T, kr); + t_release_transaction(T); +- } ++ } + } + tm_error = 0; /* clear it */ + UNREF(T);