Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions cache-config/t3c-apply/torequest/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,21 +294,9 @@ func sendUpdate(cfg config.Cfg, configApplyTime, revalApplyTime *time.Time, conf
return nil
}

// doTail calls t3c-tail, which will read lines from the file at the provided
// path, and will print lines matching the 'logMatch' regular expression.
// When a line matching the 'endMatch' regular expression is encountered,
// t3c-tail will exit - which means it MUST NOT be an empty string or only the
// first line of the file will ever be read (and possibly printed, if it matches
// 'logMatch'). In any case, the process will terminate after 'timeoutInMS'
// milliseconds.
// Note that apart from an exit code difference on timeout, this is almost
// exactly equivalent to the bash command:
//
// timeout timeoutInS tail -fn+2 file | grep -m 1 -B "$(wc -l file | cut -d ' ' -f1)" -E endMatch | grep -E logMatch
//
// ... where 'timeoutInS' is 1/1000 of 'timeoutInMS' and the string values of
// arguments are otherwise substituted wherever they are found (GNU coreutils
// are assumed to be present).
// doTail calls t3c-tail and will run a tail on the log file provided with string for a regex to
// match on default is .* endMatch will make t3c-tail exit when a pattern is matched otherwise
// a timeout in a given number of seconds will occur.
Copy link
Copy Markdown
Contributor

@ocket8888 ocket8888 Sep 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removing quite a bit of relevant information, like the fact that this prints to stdout, and also falsely claims some sort of default 'logMatch' value.

Everything after the first paragraph is arguably extraneous, but as-is this edit makes the behavior of doTail misleading at best, IMO.

func doTail(cfg config.Cfg, file string, logMatch string, endMatch string, timeoutInMS int) error {
args := []string{
"--file=" + filepath.Join(cfg.TsHome, file),
Expand Down
17 changes: 9 additions & 8 deletions docs/source/overview/delivery_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ Each :term:`Parameter` directly corresponds to a field in a line of the :abbr:`A
.. _max_simple_retries: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-max-simple-retries
.. _max_unavailable_server_retries: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-max-unavailable-server-retries
.. _parent_retry: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-parent-retry
.. _simple_server_retry_responses: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-simple-server-retry-responses
.. _unavailable_server_retry_responses: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-unavailable-server-retry-responses
.. _parent.config: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html
.. _parent: https://docs.trafficserver.apache.org/en/9.1.x/admin-guide/files/parent.config.en.html#parent-config-format-parent
Expand All @@ -1043,20 +1044,20 @@ Each :term:`Parameter` directly corresponds to a field in a line of the :abbr:`A
| algorithm | `round_robin`_ | Sets the algorithm used to determine from which :term:`origin server` content will |
| | | be requested. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+
| max_simple_retries | `max_simple_retries`_ | Sets a strict limit on the number of "simple retries" allowed before giving up |
| max_simple_retries | `max_simple_retries`_ | The number of times to try a different :term:`origin server` after receiving a |
| | | simple_retry response code. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+
| max_unavailable_server_retries | `max_unavailable_server_retries`_ | Sets a strict limit on the number of times the :term:`cache server` will attempt to |
| | | request content from an :term:`origin server` that has previously been considered |
| | | "unavailable". |
| max_unavailable_server_retries | `max_unavailable_server_retries`_ | The number of times to try a different :term:`origin server` after receiving an |
| | | unavailable_server_retry response code. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+
| parent_retry | `parent_retry`_ | Sets whether the :term:`cache servers` will use "simple retries", |
| | | "unavailable server retries", or both. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+
| simple_retry_response_codes | **UNKNOWN** | **UNKNOWN** - supposedly defines HTTP response codes from an :term:`origin server` |
| | | that necessitate a "simple retry". |
| simple_server_retry_responses | `simple_server_retry_responses`_ | Defines HTTP response codes from an :term:`origin server` that will be considered |
| | | failures but the server will still be considered healthy for future requests. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+
| unavailable_server_retry_response_codes | `unavailable_server_retry_responses`_ | Defines HTTP response codes from an :term:`origin server` that indicate it is |
| | | currently "unavailable". |
| unavailable_server_retry_responses | `unavailable_server_retry_responses`_ | Defines HTTP response codes from an :term:`origin server` that will be considered |
| | | failures and the server will be marked as unhealthy. |
+-----------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+

The above :term:`Parameters` are supported for ``first``, ``inner`` and ``last`` tiers by specifying prefixes ``first.``, ``inner.`` and ``last.``, applicable to both topology and non topology. This allows fine tuning of marking parents "down" and retry behavior inside a CDN.
Expand Down
2 changes: 1 addition & 1 deletion lib/go-atscfg/parentabstraction.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type ParentAbstractionService struct {

// ErrorResponseCodes is the list of HTTP response codes from the parent
// to consider as errors, but NOT mark the parent unhealthy. Typically 4xx codes.
// Becomes parent.config unavailable_server_retry_responses directive
// Becomes parent.config simple_server_retry_responses directive
// Becomes strategies.yaml TODO
ErrorResponseCodes []int

Expand Down
2 changes: 1 addition & 1 deletion lib/go-atscfg/parentdotconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ func getTopologyParentConfigLine(

// getParentRetries builds the parent retry directive(s).
//
// Returns the MaxSimpleRetries, MaxMarkdownRetries, ErrorREsponseCodes, MarkdownResponseCodes.
// Returns the MaxSimpleRetries, MaxMarkdownRetries, ErrorResponseCodes, MarkdownResponseCodes.
//
// If atsMajorVersion < 6, "" is returned (ATS 5 and below don't support retry directives).
// If isLastCacheTier is false, "" is returned. This argument exists to simplify usage.
Expand Down