[
https://issues.apache.org/jira/browse/TS-4028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15061309#comment-15061309
]
ASF GitHub Bot commented on TS-4028:
------------------------------------
GitHub user SolidWallOfCode opened a pull request:
https://github.com/apache/trafficserver/pull/384
TS-4028: Set TrackerContinuation to clean up.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/SolidWallOfCode/trafficserver ts-4028
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafficserver/pull/384.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #384
----
commit ad3e99fca81f822dd85e66321177cbc8fbeebb68
Author: Alan M. Carroll <[email protected]>
Date: 2015-12-17T01:42:02Z
TS-4028: Set TrackerContinuation to clean up.
----
> Does not delete old TrackerContinuation while re-setting
> proxy.config.dump_mem_info_frequency
> ---------------------------------------------------------------------------------------------
>
> Key: TS-4028
> URL: https://issues.apache.org/jira/browse/TS-4028
> Project: Traffic Server
> Issue Type: Bug
> Components: Core
> Reporter: Oknet Xu
> Assignee: Alan M. Carroll
> Fix For: 6.1.0
>
>
> the below command will make a call to init_memory_tracker():
> traffic_line -s proxy.config.dump_mem_info_frequency -v 1
> a new TrackerContinuation will be created in init_memory_tracker(), but the
> old one doesn't delete / release.
> patch here:
> {code}
> diff --git a/proxy/Main.cc b/proxy/Main.cc
> index 21ded21..0a289bb 100644
> --- a/proxy/Main.cc
> +++ b/proxy/Main.cc
> @@ -287,9 +287,19 @@ public:
> baseline_taken = 0;
> }
>
> + ~TrackerContinuation() {
> + mutex = NULL;
> + }
> +
> int
> periodic(int event, Event * /* e ATS_UNUSED */)
> {
> + if (event == EVENT_IMMEDIATE) {
> + // reschedule from period to immediately event
> + // kill self;
> + delete this;
> + return EVENT_DONE;
> + }
> if (use_baseline) {
> // TODO: TS-567 Integrate with debugging allocators "dump" features?
> ink_freelists_dump_baselinerel(stderr);
> @@ -311,19 +321,23 @@ static int
> init_memory_tracker(const char *config_var, RecDataT /* type ATS_UNUSED */,
> RecData data, void * /* cookie ATS_UNUSED */)
> {
> static Event *tracker_event = NULL;
> + Event *preE;
> int dump_mem_info_frequency = 0;
>
> + // set tracker_event to NULL, and return previous value
> + preE = (Event *)ink_atomic_swap((Event **)&tracker_event, (Event *)NULL);
> +
> if (config_var) {
> dump_mem_info_frequency = data.rec_int;
> } else {
> dump_mem_info_frequency =
> REC_ConfigReadInteger("proxy.config.dump_mem_info_frequency");
> }
>
> - Debug("tracker", "init_tracker called [%d]\n", dump_mem_info_frequency);
> + Debug("tracker", "init_memory_tracker called [%d]\n",
> dump_mem_info_frequency);
>
> - if (tracker_event) {
> - tracker_event->cancel();
> - tracker_event = NULL;
> + if (preE) {
> + eventProcessor.schedule_imm(preE->continuation, ET_CALL);
> + preE->cancel();
> }
>
> if (dump_mem_info_frequency > 0) {
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)