apache / trafficcontrol

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

Refactor Cache Config parent.config Generation #3515

Open rob05c opened 5 years ago

rob05c commented 5 years ago

The Traffic Ops parent.config generation has been transliterated from Perl to Go: https://github.com/apache/trafficcontrol/pull/3075

It's been transliterated as closely as possible, for safety. It's a very complex set of logic, and easy to get wrong, and getting it wrong can cause critical errors and potentially break traffic or even the entire CDN.

The code needs refactored. There is much duplication, very long functions, querying too much data, and other issues.

But, we don't want to completely refactor it at the same time as transliterating it, to reduce the risk of introducing errors.

So, at some point after #3075 has been running without issue, we need to go back and improve it.

When I transliterated it, I added TODO comments for all the issues I immediately saw. Those should be the starting point. But there are almost certainly other code sanity improvements that need to be made.

mitchell852 commented 3 years ago

can this be closed @rob05c?

rob05c commented 3 years ago

No, parent.config gen code is still a mess. It's overly-complicated, hard to read, and bug-prone. We need to clean it up, to make it easier to understand, faster to develop, and less prone to subtle bugs. Code is never perfect, but we need to make an initiative to clean it up and fix the incredible mess. That initiative has not been done.

mitchell852 commented 3 years ago

No, parent.config gen code is still a mess. It's overly-complicated, hard to read, and bug-prone. We need to clean it up, to make it easier to understand, faster to develop, and less prone to subtle bugs. Code is never perfect, but we need to make an initiative to clean it up and fix the incredible mess. That initiative has not been done.

ok, but can u remove the TO label and add the TO ORT label because the mess problem has shifted, right? :)

mitchell852 commented 2 years ago

@rob05c - can you rename this issue and change the description to talk about T3C instead of TO? and what do you think the impact of this "mess" is and the effort level to clean it up?

rob05c commented 2 years ago

Done. The parent.config gen code is an absolute mess, and very bug-prone. I would say both the impact and dev cost are "medium."