apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.02k stars 339 forks source link

ORT: unavailable_server_retry_responses having parsing issues #5150

Open smalenfant opened 3 years ago

smalenfant commented 3 years ago

I'm submitting a ...

Traffic Control components affected ...

Current behavior:

Only quotes string with 2 parameters are valid for unavailable_server_retry_responses. Other valid string get ignored and parameters are not been written into the parent.config.

Expected behavior:

Setting unavailable_server_retry_responses to 503 should work. Shouldn't need to be quoted either.

Minimal reproduction of the problem with instructions:

set mso.unavailable_server_retry_responses to 503. Result: ERROR: parentdotconfig.go:251: 2020-10-14T15:13:03.917552091Z: Malformed unavailable_server_retry_responses parameter '503', not using!

set mso.unavailable_server_retry_responses to "503". Result: ERROR: parentdotconfig.go:251: 2020-10-14T15:49:28.583433821Z: Malformed unavailable_server_retry_responses parameter '"503"', not using!

set mso.unavailable_server_retry_responses to 502,503. Result: ERROR: parentdotconfig.go:251: 2020-10-14T15:13:03.917599943Z: Malformed unavailable_server_retry_responses parameter '502,503', not using!

set mso.unavailable_server_retry_responses to "502,503". Works.

rob05c commented 3 years ago

Bug is in the regex here: https://github.com/apache/trafficcontrol/blob/bcd54dfd200e0b389e3f2a80cd626d7b7679db8a/lib/go-atscfg/parentdotconfig.go#L1091

mitchell852 commented 3 years ago

can u apply a severity level @smalenfant or @rob05c