apache / trafficserver

Apache Traffic Server™ is a fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server.
https://trafficserver.apache.org/
Apache License 2.0
1.82k stars 804 forks source link

records. Fix regex to make sure default values are properly loaded when configured in the `records.yaml` #11654

Closed brbzull0 closed 3 months ago

brbzull0 commented 3 months ago

Some default values weren't passing the validity check when ATS reads them from a records.yaml file This changes either the regex, or the check type to make sure the validity check don't fail when loading. This does show any error/warning unless you set them in the records.yaml file.

Tested with the following records.yaml file

Error when loading from a file.

[Aug  5 15:21:05.918] traffic_server NOTE: records parsing completed.
[Aug  5 15:21:05.918] traffic_server NOTE: Warn:   
  Warn: proxy.config.diags.logfile.rolling_min_count - Validity Check failed. '^0*[1-9][0-9]*$' against '0'. Default value will be used
  Warn: proxy.config.log.rolling_min_count - Validity Check failed. '^0*[1-9][0-9]*$' against '0'. Default value will be used
  Warn: proxy.config.output.logfile.rolling_min_count - Validity Check failed. '^0*[1-9][0-9]*$' against '0'. Default value will be used
  Warn: proxy.config.ssl.client.version.max - Validity Check failed. '^-?[0-9]+$' against '-1'. Default value will be used
  Warn: proxy.config.ssl.client.version.min - Validity Check failed. '^-?[0-9]+$' against '-1'. Default value will be used
  Warn: proxy.config.ssl.server.version.max - Validity Check failed. '^-?[0-9]+$' against '-1'. Default value will be used
  Warn: proxy.config.ssl.server.version.min - Validity Check failed. '^-?[0-9]+$' against '-1'. Default value will be used

[Aug  5 15:21:05.918] traffic_server NOTE: /opt/ats/etc/trafficserver/records.yaml finished loading

Docs:

proxy.config.diags.logfile.rolling_min_count proxy.config.log.rolling_min_count proxy.config.output.logfile.rolling_min_count

proxy.config.ssl.client.version.max proxy.config.ssl.client.version.min proxy.config.ssl.server.version.max proxy.config.ssl.server.version.min

This partially fixes https://github.com/apache/trafficserver/issues/11649

brbzull0 commented 3 months ago

[approve ci autest 3of4] argh ... well would have been nice.

maskit commented 3 months ago

Should we change all 0*[1-9][0-9]*$s? The format doesn't make sense. It looks like allowing 000123, unless the regex has some special meaning.

brbzull0 commented 3 months ago

Should we change all 0*[1-9][0-9]*$s? The format doesn't make sense. It looks like allowing 000123, unless the regex has some special meaning.

IMO, yes we should. Done

JosiahWI commented 3 months ago

The AuTest proxy_serve_stale_dns_fail failed.