Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4028

Does not delete old TrackerContinuation while re-setting proxy.config.dump_mem_info_frequency

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1.0
    • Component/s: Core
    • Labels:
      None

      Description

      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:

      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) {
      

        Attachments

          Activity

            People

            • Assignee:
              amc Alan M. Carroll
              Reporter:
              oknet Oknet Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: