[Home]

Summary:ASTERISK-09923: [patch] Dialplan mutexes
Reporter:Tilghman Lesher (tilghman)Labels:
Date Opened:2007-07-20 21:56:25Date Closed:2007-08-06 17:16:15
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Functions/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) func_lock.c
Description:As discussed on IRC earlier today, we need a replacement for MacroExclusive when Macro is deprecated in 1.6.
Comments:By: Tilghman Lesher (tilghman) 2007-07-23 10:24:39

1.  The locks are not stored on the channel; they are stored in a list inside func_lock.  There is, however, a link to the appropriate lock from inside the channel.

2.  We could implement multiple locks, but my choice was to not give the user enough rope to deadlock Asterisk.  If channel A has lock X and channel B has lock Y, then a deadlock could result if channel A tries to lock Y and channel B tries to lock X.  By forcing an unlock, no deadlock is possible.

3.  I've thought about another possibility of avoiding deadlocks.  If the order in which locks are allocated is the same priority order by which locks must be acquired, we can create a situation whereby deadlocks can be avoided, yet multiple locks can be held.  I've held off creating that system for the time being, however, as I'm not sure how useful it is to force a particular locking order, absent administrator preference.

By: Steve Murphy (murf) 2007-07-23 11:25:12

Ooops again. Deleted the comments that provoked your reply, before refreshing, to see your reply. Let me note that I asked a stupid question: were the locks stored on the channel, which was answered above,  and 2. were multiple locks so evil, as not to be allowed, and after a bit of discussion on IRC, I concluded that limiting users to just one lock at a time was not an unreasonable thing. The issues start getting very complex, and the price of failure is catastrophic to asterisk.

By: Digium Subversion (svnbot) 2007-07-31 11:27:06

Repository: asterisk
Revision: 77834

------------------------------------------------------------------------
r77834 | tilghman | 2007-07-31 11:27:03 -0500 (Tue, 31 Jul 2007) | 3 lines

Add func_lock, which creates dialplan mutexes, and note that the Macro apps are now deprecated.
(Closes issue ASTERISK-9923)

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-07-31 21:28:04

Repository: asterisk
Revision: 77850

------------------------------------------------------------------------
r77850 | murf | 2007-07-31 21:28:01 -0500 (Tue, 31 Jul 2007) | 99 lines

Merged revisions 77819-77821,77825,77828-77829,77833-77834,77838,77847 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r77819 | kpfleming | 2007-07-31 08:54:46 -0600 (Tue, 31 Jul 2007) | 3 lines

umm... let's build with --enable-dev-mode, mmkay?


................
r77820 | kpfleming | 2007-07-31 08:55:37 -0600 (Tue, 31 Jul 2007) | 2 lines

use a different method for overriding the send_digit_begin pointer, as the old one fails to compile on my 64-bit system with gcc-4.1 and --enable-dev-mode turned on

................
r77821 | kpfleming | 2007-07-31 09:01:27 -0600 (Tue, 31 Jul 2007) | 2 lines

there is no use in having functions that have no code in them, and hide the locking info when DEBUG_THREADS is enabled... i could have fixed this to be dependent on DEBUG_THREADS, but it would be just as easy for someone to add their test/debugging code to the macros as it would have been to the functions

................
r77825 | mmichelson | 2007-07-31 09:22:32 -0600 (Tue, 31 Jul 2007) | 14 lines

Merged revisions 77824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77824 | mmichelson | 2007-07-31 10:21:22 -0500 (Tue, 31 Jul 2007) | 6 lines

This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.

(closes issue ASTERISK-9933, reported by cstadlmann, patched by me with approval from file)


........

................
r77828 | kpfleming | 2007-07-31 09:54:29 -0600 (Tue, 31 Jul 2007) | 10 lines

Merged revisions 77827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77827 | kpfleming | 2007-07-31 10:53:42 -0500 (Tue, 31 Jul 2007) | 2 lines

DETECT_DEADLOCKS can't be enabled without DEBUG_THREADS or it does nothing

........

................
r77829 | murf | 2007-07-31 09:59:01 -0600 (Tue, 31 Jul 2007) | 1 line

thanks to Russel, for pointing out that the dialoglist_lock/unlock routines also need to be macros if DETECT_DEADLOCKS is set
................
r77833 | file | 2007-07-31 10:21:34 -0600 (Tue, 31 Jul 2007) | 10 lines

Merged revisions 77831 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77831 | file | 2007-07-31 13:17:09 -0300 (Tue, 31 Jul 2007) | 2 lines

Add a flag to the speech API that allows an engine to set whether it received results or not.

........

................
r77834 | tilghman | 2007-07-31 10:44:25 -0600 (Tue, 31 Jul 2007) | 3 lines

Add func_lock, which creates dialplan mutexes, and note that the Macro apps are now deprecated.
(Closes issue ASTERISK-9923)

................
r77838 | tilghman | 2007-07-31 12:50:06 -0600 (Tue, 31 Jul 2007) | 2 lines

Add some documentation detailing an aspect of dialplan functions, as requested by Russell

................
r77847 | murf | 2007-07-31 15:33:37 -0600 (Tue, 31 Jul 2007) | 17 lines

Merged revisions 77844 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r77844 | murf | 2007-07-31 14:59:10 -0600 (Tue, 31 Jul 2007) | 9 lines

Merged revisions 77842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77842 | murf | 2007-07-31 13:19:35 -0600 (Tue, 31 Jul 2007) | 1 line

This probably isn't super-general, but it's a first stab at using kill -11 to generate a core file instead of gcore.
........

................

................

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-08-06 17:16:15

Repository: asterisk
Revision: 78298

------------------------------------------------------------------------
r78298 | murf | 2007-08-06 17:16:13 -0500 (Mon, 06 Aug 2007) | 151 lines

Merged revisions 77850,77893,77906,77961,78003,78038,78070,78110,78199,78230,78250,78267 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/group/CDRfix5

................
r77850 | murf | 2007-07-31 20:45:22 -0600 (Tue, 31 Jul 2007) | 99 lines

Merged revisions 77819-77821,77825,77828-77829,77833-77834,77838,77847 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r77819 | kpfleming | 2007-07-31 08:54:46 -0600 (Tue, 31 Jul 2007) | 3 lines

umm... let's build with --enable-dev-mode, mmkay?


................
r77820 | kpfleming | 2007-07-31 08:55:37 -0600 (Tue, 31 Jul 2007) | 2 lines

use a different method for overriding the send_digit_begin pointer, as the old one fails to compile on my 64-bit system with gcc-4.1 and --enable-dev-mode turned on

................
r77821 | kpfleming | 2007-07-31 09:01:27 -0600 (Tue, 31 Jul 2007) | 2 lines

there is no use in having functions that have no code in them, and hide the locking info when DEBUG_THREADS is enabled... i could have fixed this to be dependent on DEBUG_THREADS, but it would be just as easy for someone to add their test/debugging code to the macros as it would have been to the functions

................
r77825 | mmichelson | 2007-07-31 09:22:32 -0600 (Tue, 31 Jul 2007) | 14 lines

Merged revisions 77824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77824 | mmichelson | 2007-07-31 10:21:22 -0500 (Tue, 31 Jul 2007) | 6 lines

This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.

(closes issue ASTERISK-9933, reported by cstadlmann, patched by me with approval from file)


........

................
r77828 | kpfleming | 2007-07-31 09:54:29 -0600 (Tue, 31 Jul 2007) | 10 lines

Merged revisions 77827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77827 | kpfleming | 2007-07-31 10:53:42 -0500 (Tue, 31 Jul 2007) | 2 lines

DETECT_DEADLOCKS can't be enabled without DEBUG_THREADS or it does nothing

........

................
r77829 | murf | 2007-07-31 09:59:01 -0600 (Tue, 31 Jul 2007) | 1 line

thanks to Russel, for pointing out that the dialoglist_lock/unlock routines also need to be macros if DETECT_DEADLOCKS is set
................
r77833 | file | 2007-07-31 10:21:34 -0600 (Tue, 31 Jul 2007) | 10 lines

Merged revisions 77831 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77831 | file | 2007-07-31 13:17:09 -0300 (Tue, 31 Jul 2007) | 2 lines

Add a flag to the speech API that allows an engine to set whether it received results or not.

........

................
r77834 | tilghman | 2007-07-31 10:44:25 -0600 (Tue, 31 Jul 2007) | 3 lines

Add func_lock, which creates dialplan mutexes, and note that the Macro apps are now deprecated.
(Closes issue ASTERISK-9923)

................
r77838 | tilghman | 2007-07-31 12:50:06 -0600 (Tue, 31 Jul 2007) | 2 lines

Add some documentation detailing an aspect of dialplan functions, as requested by Russell

................
r77847 | murf | 2007-07-31 15:33:37 -0600 (Tue, 31 Jul 2007) | 17 lines

Merged revisions 77844 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r77844 | murf | 2007-07-31 14:59:10 -0600 (Tue, 31 Jul 2007) | 9 lines

Merged revisions 77842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77842 | murf | 2007-07-31 13:19:35 -0600 (Tue, 31 Jul 2007) | 1 line

This probably isn't super-general, but it's a first stab at using kill -11 to generate a core file instead of gcore.
........

................

................

................
r77893 | murf | 2007-08-01 18:16:13 -0600 (Wed, 01 Aug 2007) | 1 line

As per suggestion of Tilghman, we split the read and write of CDR_CONTROL; begin automation of CDR output for non-answer cases
................
r77906 | automerge | 2007-08-02 09:39:28 -0600 (Thu, 02 Aug 2007) | 1 line

automerge commit
................
r77961 | automerge | 2007-08-02 13:51:54 -0600 (Thu, 02 Aug 2007) | 1 line

automerge commit
................
r78003 | automerge | 2007-08-02 17:36:08 -0600 (Thu, 02 Aug 2007) | 1 line

automerge commit
................
r78038 | automerge | 2007-08-03 01:35:47 -0600 (Fri, 03 Aug 2007) | 1 line

automerge commit
................
r78070 | automerge | 2007-08-03 11:35:27 -0600 (Fri, 03 Aug 2007) | 1 line

automerge commit
................
r78110 | automerge | 2007-08-03 14:35:41 -0600 (Fri, 03 Aug 2007) | 1 line

automerge commit
................
r78199 | automerge | 2007-08-06 12:28:47 -0600 (Mon, 06 Aug 2007) | 1 line

automerge commit
................
r78230 | automerge | 2007-08-06 14:26:05 -0600 (Mon, 06 Aug 2007) | 1 line

automerge commit
................
r78250 | automerge | 2007-08-06 15:27:29 -0600 (Mon, 06 Aug 2007) | 1 line

automerge commit
................
r78267 | murf | 2007-08-06 15:36:13 -0600 (Mon, 06 Aug 2007) | 1 line

Next installment on getting Asterisk to post unanswered, busy, failed calls
................

------------------------------------------------------------------------