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

Wrong logic around read_while_writer configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.7
    • Configuration
    • None

    Description

      I think the logic around how we read / use the read_while_writer configuration is wrong. The logic should be to only enable read_while_writer if all these configs are set exactly like this:

      CONFIG proxy.config.cache.enable_read_while_writer INT 1
      CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.0
      CONFIG proxy.config.cache.max_doc_size INT 0
      

      This logic is encapsulated in a function

      static int
      update_cache_config(const char *name, RecDataT data_type, RecData data, void *cookie)
      {
        (void) name;
        (void) data_type;
        (void) cookie;
        int new_value = data.rec_int;
        if (new_value) {
          float http_bg_fill;
          IOCORE_ReadConfigFloat(http_bg_fill, "proxy.config.http.background_fill_completed_threshold");
          if (http_bg_fill > 0.0) {
            Note("to enable reading while writing a document, %s should be 0.0: read while writing disabled",
                 "proxy.config.http.background_fill_completed_threshold");
            return 0;
          }
          if (cache_config_max_doc_size > 0) {
            Note("to enable reading while writing a document, %s should be 0: read while writing disabled",
                 "proxy.config.cache.max_doc_size");
            return 0;
          }
        }
        cache_config_read_while_writer = new_value;
        return 0;
      }
      

      But, as far as I can tell, this doesn't take effect unless the configuration is reloaded, e.g.

      IOCORE_EstablishStaticConfigInt32(cache_config_read_while_writer, "proxy.config.cache.enable_read_while_writer");
      IOCORE_RegisterConfigUpdateFunc("proxy.config.cache.enable_read_while_writer", update_cache_config, NULL);
      

      At least from what I can tell, enabling read_while_writer takes effect even if those other two preconditions aren't satisfied. At least when running ATS from command line (traffic_server).

      Attachments

        Activity

          People

            zwoop Leif Hedstrom
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: