Commit Graph

3781 Commits

Author SHA1 Message Date
Mark Michelson bdd8da406b Address review board feedback from Matt and Richard
* Remove extraneous whitespace
* Bump up debug levels of messages and add identifying info to messages.
* Account for potential failures of ao2_link()
* Add additional test and some more test data
* Add some comments in places where they could be useful
* Make threadpool listeners and their callbacks optional



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-07 22:16:06 +00:00
Automerge script f824b845ce Merged revisions 378458,378460 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378458 | rmudgett | 2013-01-03 12:47:29 -0600 (Thu, 03 Jan 2013) | 18 lines
  
  chan_agent: Misc code cleanup.
  
  * Fix off-nominal path resource cleanup in agent_request().
  
  * Create agent_pvt_destroy() to eliminate inlined versions in many places.
  
  * Pull invariant code out of loop in add_agent().
  
  * Remove redundant module user references in login_exec().
  
  * Remove unused struct agent_pvt logincallerid[] member.
  ........
  
  Merged revisions 378456 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378457 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378460 | kmoore | 2013-01-03 12:51:43 -0600 (Thu, 03 Jan 2013) | 13 lines
  
  Add missing test event
  
  This test event was missing from channel.c causing the dial_LS_options
  test to fail intermittently because of a race condition where most code
  paths emitted the test event but this one did not. The dial_LS_options
  test should stop bouncing now.
  ........
  
  Merged revisions 378455 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378459 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03 19:19:40 +00:00
Automerge script b375abae50 Merged revisions 378374,378377,378384 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378374 | rmudgett | 2013-01-02 15:23:16 -0600 (Wed, 02 Jan 2013) | 33 lines
  
  Fix AMI redirect action with two channels failing to redirect both channels.
  
  The AMI redirect action can fail to redirect two channels that are bridged
  together.  There is a race between the AMI thread redirecting the two
  channels and the bridge thread noticing that a channel is hungup from the
  redirects.
  
  * Made the bridge wait for both channels to be redirected before exiting.
  
  * Made the AMI redirect check that all required headers are present before
  proceeding with the redirection.
  
  * Made the AMI redirect require that any supplied ExtraChannel exist
  before proceeding.  Previously the code fell back to a single channel
  redirect operation.
  
  (closes issue ASTERISK-18975)
  Reported by: Ben Klang
  
  (closes issue ASTERISK-19948)
  Reported by: Brent Dalgleish
  Patches:
        jira_asterisk_19948_v11.patch (license #5621) patch uploaded by rmudgett
  Tested by: rmudgett, Thomas Sevestre, Deepak Lohani, Kayode
  
  Review: https://reviewboard.asterisk.org/r/2243/
  ........
  
  Merged revisions 378356 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378358 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378377 | mjordan | 2013-01-02 16:10:32 -0600 (Wed, 02 Jan 2013) | 24 lines
  
  Prevent crashes from occurring when reading from data sources with large values
  
  When reading configuration data from an Asterisk .conf file or when pulling
  data from an Asterisk RealTime backend, Asterisk was copying the data on the
  stack for manipulation. Unfortunately, it is possible to read configuration
  data or realtime data from some data source that provides a large blob of
  characters. This could potentially cause a crash via a stack overflow.
  
  This patch prevents large sets of data from being read from an ARA backend or
  from an Asterisk conf file.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes
  Tested by: wdoekes, mmichelson
  patches:
   * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
   * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
  ........
  
  Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378384 | mjordan | 2013-01-02 16:19:32 -0600 (Wed, 02 Jan 2013) | 11 lines
  
  Clean up app_mysql's application entry points to properly parse arguments
  
  When parsing arguments, application entry points should not attempt to
  directly modify the parameters to the function. This patch properly duplicates
  the passed in parameters before attempting to parse them.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes
  patches:
    issueA20658_sanitize_app_mysql.patch uploaded by wdoekes (license 5674)
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 22:19:49 +00:00
Automerge script 675914bb17 Merged revisions 378322 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378322 | mjordan | 2013-01-02 12:11:59 -0600 (Wed, 02 Jan 2013) | 33 lines
  
  Prevent exhaustion of system resources through exploitation of event cache
  
  Asterisk maintains an internal cache for devices in the event subsystem. The
  device state cache holds the state of each device known to Asterisk, such that
  consumers of device state information can query for the last known state for
  a particular device, even if it is not part of an active call. The concept of
  a device in Asterisk can include entities that do not have a physical
  representation. One way that this occurred was when anonymous calls are allowed
  in Asterisk. A device was automatically created and stored in the cache for
  each anonymous call that occurred; this was possible in the SIP and IAX2
  channel drivers and through channel drivers that utilized the
  res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
  are never removed from the system, allowing anonymous calls to potentially
  exhaust a system's resources.
  
  This patch changes the event cache subsystem and device state management to
  no longer cache devices that are not associated with a physical entity.
  
  (issue ASTERISK-20175)
  Reported by: Russell Bryant, Leif Madsen, Joshua Colp
  Tested by: kmoore
  patches:
    event-cachability-3.diff uploaded by jcolp (license 5000)
  ........
  
  Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:20:03 +00:00
Automerge script 5966364588 Merged revisions 378288 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378288 | mjordan | 2013-01-02 09:39:42 -0600 (Wed, 02 Jan 2013) | 36 lines
  
  Resolve crashes due to large stack allocations when using TCP
  
  Asterisk had several places where messages received over various network
  transports may be copied in a single stack allocation. In the case of TCP,
  since multiple packets in a stream may be concatenated together, this can
  lead to large allocations that overflow the stack.
  
  This patch modifies those portions of Asterisk using TCP to either
  favor heap allocations or use an upper bound to ensure that the stack will not
  overflow:
   * For SIP, the allocation now has an upper limit
   * For HTTP, the allocation is now a heap allocation instead of a stack
     allocation
   * For XMPP (in res_jabber), the allocation has been eliminated since it was
     unnecesary.
  
  Note that the HTTP portion of this issue was independently found by Brandon
  Edwards of Exodus Intelligence.
  
  (issue ASTERISK-20658)
  Reported by: wdoekes, Brandon Edwards
  Tested by: mmichelson, wdoekes
  patches:
    ASTERISK-20658_res_jabber.c.patch uploaded by mmichelson (license 5049)
    issueA20658_http_postvars_use_malloc2.patch uploaded by wdoekes (license 5674)
    issueA20658_limit_sip_packet_size3.patch uploaded by wdoekes (license 5674)
  ........
  
  Merged revisions 378269 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378286 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378287 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 16:20:01 +00:00
Automerge script 550581db83 Merged revisions 378166 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378166 | rmudgett | 2012-12-20 15:51:03 -0600 (Thu, 20 Dec 2012) | 8 lines
  
  Give the causes[] a struct name.
  ........
  
  Merged revisions 378164 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378165 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-20 22:18:25 +00:00
Automerge script e0fa5cf52d Merged revisions 378122 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378122 | kmoore | 2012-12-18 11:48:36 -0600 (Tue, 18 Dec 2012) | 17 lines
  
  Add test events for time limit-related hangups
  
  This patch adds hangup-related test events in order to support testing
  of time-limited bridges. This aids in testing the S() and L() bridge
  options.
  
  (issue SWP-4713)
  ........
  
  Merged revisions 378119 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378120 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378121 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-18 18:18:44 +00:00
Automerge script 84e6a9847a Merged revisions 378091,378095 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378091 | rmudgett | 2012-12-17 17:02:54 -0600 (Mon, 17 Dec 2012) | 22 lines
  
  Make chan_local module references tied to local_pvt lifetime.
  
  The chan_local module references were manually tied to the existence of
  the ;1 and ;2 channel links.
  
  * Made chan_local module references tied to the existence of the local_pvt
  structure as well as automatically take care of the module references.
  
  * Tweaked the wording of the local_fixup() failure warning message to make
  sense.
  
  Review: https://reviewboard.asterisk.org/r/2181/
  ........
  
  Merged revisions 378088 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378089 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378090 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r378095 | rmudgett | 2012-12-17 17:10:42 -0600 (Mon, 17 Dec 2012) | 11 lines
  
  Fix potential double free when unloading a module.
  ........
  
  Merged revisions 378092 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 378093 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 378094 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 23:18:40 +00:00
Automerge script be4cc7b20b Merged revisions 378072,378074 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r378072 | rmudgett | 2012-12-17 14:34:25 -0600 (Mon, 17 Dec 2012) | 9 lines
  
  chan_local: Misc lock and ref tweaks.
  
  * awesome_locking() does not need to thrash the pvt lock as much.
  
  * local_setoption() does not need to check for NULL pvt on cleanup since
  it will never be NULL.
  
  * Made ref the pvt before locking for consistency.
................
  r378074 | qwell | 2012-12-17 14:59:51 -0600 (Mon, 17 Dec 2012) | 10 lines
  
  Make libasteriskssl.so symlink use a relative path.
  
  This was causing issues when using DESTDIR, since the path to which the link
  pointed is not likely to exist (and not useful to exist) on the target system.
  
  (issue ASTNOW-284)
  ........
  
  Merged revisions 378073 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-17 21:18:01 +00:00
Automerge script d4aeeecffa Merged revisions 378063-378064 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r378063 | jrose | 2012-12-14 16:34:18 -0600 (Fri, 14 Dec 2012) | 8 lines
  
  Features: BRIDGE_FEATURES variable automixmonitor support and use proper party
  
  BRIDGE_FEATURES did not previously support the automixmonitor feature. Now it
  does. In addition, the BRIDGE_FEATURES variable would not apply features to
  the proper party based on whether the feature option letter was in caps or
  in lowercase (both ways would apply it to the caller). Now uppercase applies
  to the caller while lowercase applies to the callee (like with the dial option)
........
  r378064 | rmudgett | 2012-12-14 16:45:03 -0600 (Fri, 14 Dec 2012) | 4 lines
  
  chan_agent: Remove some duplicated code.
  
  No need to check for an agent twice.  Santa does that.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14 23:17:59 +00:00
Mark Michelson ece4c95798 Resolve conflict and reset automerge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 16:39:40 +00:00
Automerge script 57d2e81d78 Merged revisions 377915 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r377915 | elguero | 2012-12-11 22:43:18 -0600 (Tue, 11 Dec 2012) | 17 lines
  
  Convert Dynamic Features Buffer To Use ast_str
  
  Currently, the buffer for the dynamic features list is set to a fixed size of
  128.  If the list is bigger than that, it results in the dynamic feature(s) not
  being recognized.
  
  This patch changes the buffer from a fixed size to a dynamic one.
  
  (closes issue ASTERISK-20680)
  Reported by: Clod Patry
  Tested by: Michael L. Young
  Patches: 
      asterisk-20680-dynamic-features-v2.diff 
                                       uploaded by Michael L. Young (license 5026)
  
  Review: https://reviewboard.asterisk.org/r/2221/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-12 05:17:36 +00:00
Automerge script 686cdd0e79 Merged revisions 377906 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

........
  r377906 | mmichelson | 2012-12-11 16:42:11 -0600 (Tue, 11 Dec 2012) | 3 lines
  
  Add test events necessary for bridging tests to be able to properly run.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 23:17:37 +00:00
Mark Michelson 817a78075a Reset automerge property.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 22:25:21 +00:00
Mark Michelson f5e9cf5975 Add automerge property back after conflict.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 21:52:09 +00:00
Automerge script 090b9e09f7 Merged revisions 377809 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377809 | rmudgett | 2012-12-11 14:05:32 -0600 (Tue, 11 Dec 2012) | 23 lines
  
  Cleanup pbx on exit.
  
  * Cleanup CLI commands on exit.
  
  * Unreference hints and statecbs containers on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        pbx-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        pbx-cleanup-10.patch (license #5909) patch uploaded by Corey Farrell
        pbx-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377806 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377807 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377808 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 20:20:16 +00:00
Mark Michelson 7995bc63c7 Some general cleanup, plus we now send state changes when threads activate.
This is now ready for review board, imo!



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:53:16 +00:00
Mark Michelson 2abda64003 Add threadpool option version check into threadpool creation routine.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:36:08 +00:00
Mark Michelson 8760e32ae3 Add auto-increment option and accompanying test.
This allows for the threadpool to automatically grow if tasks
are pushed to it and no idle threads are currently available.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 16:34:00 +00:00
Mark Michelson 29fc122783 Some documentation fixes and function call name fixes.
The documentation for taskprocessors was incorrect with
regards to when a listener's alloc callback was called.

I also made the names of queued function calls in the
threadpool more uniform.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 04:23:31 +00:00
Automerge script 605dcfad97 Merged revisions 377774 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377774 | rmudgett | 2012-12-10 20:44:53 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup logger on exit.
  
  * Cleanup CLI commands, destroy verbosers and logchannels lists on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        logger-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377771 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377772 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377773 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 03:19:39 +00:00
Automerge script 4abf332cf0 Merged revisions 377743 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377743 | rmudgett | 2012-12-10 20:13:37 -0600 (Mon, 10 Dec 2012) | 25 lines
  
  Cleanup indications on exit.
  
  * Made ast_unregister_indication_country() unlink the found tone zone
  before selecting a new default_tone_zone to make it impossible to select
  the tone zone being unregistered again.
  
  * Ringcadence is no longer parsed twice in store_config_tone_zone().
  
  * Cleanup CLI commands and destroy default_tone_zone on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        indications-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377740 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377741 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377742 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 02:19:39 +00:00
Automerge script 56a9f5b6cb Merged revisions 377707,377711 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377707 | rmudgett | 2012-12-10 18:37:01 -0600 (Mon, 10 Dec 2012) | 20 lines
  
  Cleanup dnsmgr on exit.
  
  * Cleanup dnsmgr thread and CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        dnsmgr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        dnsmgr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377704 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377705 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377706 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377711 | rmudgett | 2012-12-10 19:04:50 -0600 (Mon, 10 Dec 2012) | 19 lines
  
  Cleanup event on exit.
  
  * Cleanup CLI commands on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        event_shutdown-10-only.patch (license #5909) patch uploaded by Corey Farrell
        event_shutdown-1_8-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377708 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377709 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377710 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 01:19:39 +00:00
Mark Michelson 1310e659bd Solve the issue about the "CHANGE THIS" and "XXX CHANGE THIS XXX" taskprocessor names.
Unfortunately, this required a taskprocessor listener change that makes listener allocation
utterly silly. I'm going to change the scheme so that allocation of taskprocessor listeners
is done internally within taskprocessor code. This will make it parallel with threadpool
code, which is a good thing.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 20:14:23 +00:00
Mark Michelson 64deed062a Add threadpool options and accompanying test.
The only test added so far is an idle thread timeout
option. This will greatly aid threadpool users who wish
to maintain a threadpool by allowing for idle threads to
die out as necessary.

Test passes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 06:13:09 +00:00
Mark Michelson 5dd22df050 Improve shutdown procedure.
This helps tests to pass more often than before.
They are far less likely to queue extra processes
into the control taskprocessor since they are prevented
once the threadpool begins to shut down.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 05:25:38 +00:00
Mark Michelson 03d617040a Add safeguards to ensure we don't improperly access a destroyed taskprocessor.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 04:08:29 +00:00
Automerge script 955307ef9f Merged revisions 377506,377512 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377506 | tilghman | 2012-12-09 19:29:32 -0600 (Sun, 09 Dec 2012) | 11 lines
  
  Remove some dead code and additionally handle a case that wasn't handled.
  ........
  
  Merged revisions 377487 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377504 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377505 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377512 | tilghman | 2012-12-09 19:41:50 -0600 (Sun, 09 Dec 2012) | 22 lines
  
  Improve documentation by making all of the colors used readable,
  no matter what the background color is.
  
  Dark blue on a black background is unreadable, as is yellow on a
  light background.  This patch turns on the bright attribute for
  colors when on a dark background and turns *off* the bright
  attribute when the -W command line option is used (indicating a
  _light_ background).  This ensures that text is readable in both
  cases.
  
  Patch by: tilghman
  Review: https://reviewboard.asterisk.org/r/2224
  ........
  
  Merged revisions 377509 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377510 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377511 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 02:20:30 +00:00
Mark Michelson 7be7baba30 Remove unnecessary debugging and add some useful debugging.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-09 19:10:14 +00:00
Mark Michelson 293b18ecce Create longer thread destruction test.
This one involves shrinking the threadpool in such
a way that both idle and active threads are affected.

This test made me re-realize why the zombie state exists,
so I re-added it. We don't want to clog up the control
taskprocessor by waiting on active threads to complete
what they are doing. Instead, we mark them as zombies so
that when they are done, they can clean themselves up
properly.

Without the zombie state available, the new test actually
will deadlock.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-09 18:56:25 +00:00
Automerge script c75b8c5283 Merged revisions 377402 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377402 | rmudgett | 2012-12-07 17:45:15 -0600 (Fri, 07 Dec 2012) | 11 lines
  
  MALLOC_DEBUG: Only wait if we want atexit allocation dumps.
  ........
  
  Merged revisions 377398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377399 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377401 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-08 00:19:39 +00:00
Mark Michelson b8f35bb197 Remove unsafe write of listener member.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 21:53:18 +00:00
Mark Michelson 3a25935f7d Fix infinite looping and crash problem.
MALLOC_DEBUG is complaining about corrupted memory on taskprocessor
listeners, but I'm not seeing it, nor is valgrind. Not sure what's up
there.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 19:05:30 +00:00
Mark Michelson 4590bfd93d Add new threadpool test and fix some taskprocessor bugs.
The new thread creation test fails because Asterisk locks up
while trying to lock a taskprocessor.

While trying to debug that, I found a race condition during taskprocessor
creation where a default taskprocessor listener could try to operate on
a partially started taskprocessor. This was fixed by adding a new callback
to taskprocessor listeners.

Then while testing that change, I found some bugs in the taskprocessor
tests where I was not properly unlocking when done with a lock. Scoped
locks have spoiled me a bit.

I still have not figured out why the threadpool thread creation test
is locking up.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-07 00:30:35 +00:00
Mark Michelson 9445402925 It helps if we actually assign the listener to the pool.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 20:45:42 +00:00
Mark Michelson c32634e0dd Add initial simple threadpool test.
This one simply pushes a task into the threadpool and ensures
that the listener gets the callbacks expected.

It currently crashes, so I need to figure out what's wrong.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 20:25:17 +00:00
Automerge script 95b571b390 Merged revisions 377324,377329-377330 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377324 | mjordan | 2012-12-06 08:26:13 -0600 (Thu, 06 Dec 2012) | 13 lines
  
  Fix memory leak in 'manager show event' when command entered incorrectly
  
  When the CLI command 'manager show event' was run incorrectly and its usage
  instructions returned, a reference to the event container was leaked. This
  would prevent the container from being reclaimed when Asterisk exits. We now
  properly decrement the count on the ao2 object using the nifty RAII_VAR macro.
  
  Thanks to Russell for helping me stumble on this, and Terry for writing that
  ridiculously helpful macro.
  ........
  
  Merged revisions 377319 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377329 | russell | 2012-12-06 09:06:47 -0600 (Thu, 06 Dec 2012) | 7 lines
  
  Add CLI tab completion to 'acl show'.
  
  The 'acl show' CLI command allows you to show the details about a specific
  named ACL in acl.conf.  This patch adds tab completion to the command.
  
  Review: https://reviewboard.asterisk.org/r/2230/
................
  r377330 | russell | 2012-12-06 09:13:37 -0600 (Thu, 06 Dec 2012) | 6 lines
  
  Minor code cleanup in named_acl.c.
  
  This patch makes a few little cleanups to named_acl.c.  A couple non-public
  functions were made static and an opening brace for a function was moved to
  its own line, per the coding guidelines.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-06 15:19:58 +00:00
Automerge script 521f9e8dfe Merged revisions 377245-377246 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377245 | rmudgett | 2012-12-04 20:20:57 -0600 (Tue, 04 Dec 2012) | 8 lines
  
  Fix registering core show codecs/codec CLI commands twice.
  ........
  
  Merged revisions 377241 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377244 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377246 | rmudgett | 2012-12-04 20:23:10 -0600 (Tue, 04 Dec 2012) | 1 line
  
  Remove init_framer(). It no longer does anything.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-05 03:19:08 +00:00
Mark Michelson cc63d2c380 Add better listener support.
Add some parameters to listener callbacks.
Add alloc and destroy callbacks for listeners.
Add public function for allocating a listener.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 23:45:39 +00:00
Mark Michelson 2158005bdb Remove zombie state from threadpool altogether.
After giving it some consideration, there's no real
use for zombie threads. Listeners can't really use the
current number of zombie threads as a way of gauging activity,
zombifying threads is just an extra step before they die that
really serves no purpose, and since there's no way to re-animate
zombies, the operation does not need to be around.

I also fixed up some miscellaneous compilation errors that
were lingering from some past revisions.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 22:11:31 +00:00
Mark Michelson c16371fab6 Simplify threadpool refcounting a bit.
Since threadpool shutdown is very strictly controlled,
there is no need to be so precise with reference counts
in queued operations. Since the threadpool shuts down its
own control taskprocessor before doing anything else destructive,
it can be guaranteed that all queued tasks will have a valid
pointer to the pool. This meant that some destructor functions
for helper structs could be removed entirely.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 21:21:15 +00:00
Mark Michelson a37fb2e8c8 Add some doxygen and rearrange code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-04 21:11:34 +00:00
Automerge script f40b6ad46d Merged revisions 377168 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377168 | rmudgett | 2012-12-03 17:00:08 -0600 (Mon, 03 Dec 2012) | 21 lines
  
  Cleanup ast_run_atexits() atexits list.
  
  * Convert atexits list to a mutex instead of a rd/wr lock.  The lock is
  only write locked.
  
  * Move CLI verbose Asterisk ending message to where AMI message is output
  in really_quit() to avoid further surprises about using stuff already
  shutdown.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  ........
  
  Merged revisions 377165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377166 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377167 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 23:19:30 +00:00
Automerge script d53adbe449 Merged revisions 377138 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377138 | rmudgett | 2012-12-03 14:46:11 -0600 (Mon, 03 Dec 2012) | 23 lines
  
  Cleanup core main on exit.
  
  * Cleanup time zones on exit.
  
  * Make exit clean/unclean report consistent for AMI and CLI in
  really_quit().
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
        core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 21:19:40 +00:00
Automerge script aea70ddc83 Merged revisions 377107 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377107 | rmudgett | 2012-12-03 13:33:06 -0600 (Mon, 03 Dec 2012) | 16 lines
  
  Cleanup config cache on exit.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377106 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 20:19:34 +00:00
Automerge script 1ba058bb7d Merged revisions 377072,377077 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377072 | rmudgett | 2012-12-03 12:45:18 -0600 (Mon, 03 Dec 2012) | 21 lines
  
  Cleanup CDR resources on exit.
  
  * Simplify do_reload() return handling since it never returned anything
  other than 0.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        cdr-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
        cdr-cleanup-10-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377069 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377070 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377071 from http://svn.asterisk.org/svn/asterisk/branches/11
................
  r377077 | rmudgett | 2012-12-03 13:17:24 -0600 (Mon, 03 Dec 2012) | 18 lines
  
  Cleanup CLI resources on exit and CLI command registration errors.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        cli-leaks-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
        cli-leaks-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
        Modified
  ........
  
  Merged revisions 377073 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377074 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377075 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 19:19:39 +00:00
Mark Michelson 66fe664c00 Fix a few miscellaneous things
* Renamed some taskprocessor listener callbacks
* Fixed what would become a refcounting issue for pools
* Removed some XXX comments from allocation failure points



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 17:24:11 +00:00
Automerge script f6f7774b19 Merged revisions 377035,377040 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk

................
  r377035 | oej | 2012-12-03 10:45:49 -0600 (Mon, 03 Dec 2012) | 2 lines
  
  Formatting fixes
................
  r377040 | rmudgett | 2012-12-03 11:10:40 -0600 (Mon, 03 Dec 2012) | 16 lines
  
  Fix CCSS CLI commands and logger level not unregistered.
  
  (issue ASTERISK-20649)
  Reported by: Corey Farrell
  Patches:
        ccss-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
  ........
  
  Merged revisions 377037 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 377038 from http://svn.asterisk.org/svn/asterisk/branches/10
  ........
  
  Merged revisions 377039 from http://svn.asterisk.org/svn/asterisk/branches/11
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 17:19:46 +00:00
Mark Michelson e7ce12839d This now compiles.
That's a milestone, of sorts. Things really need
arranging/documenting, and there's no function to
be able to push tasks to a threadpool.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 16:59:26 +00:00
Mark Michelson e044fa5fde Some more progress.
Still does not compile.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-30 00:19:50 +00:00