Discuss: Maintain cycle dependency breaker together

TiDB does have a few cycle dependency breakers, like:

  • util/tableutil/tableutil.go
  • util/sqlexec/restricted_sql_executor.go

As they are used internally, I’d suggest we move these codes into one dedicated path said cycledepbreaker, and layout as several packages.

This way, we keep track explicitly on cycle dependencies and force to face them instead of cover the problem under util, which is put anything if the developer cannot determine where a file to go.

What do you think? Is there other cycle dependency breaker?

I think we should try the best to avoid using the dependency breaker method. It is powerful but evil.:worried:

Yep. We should finally avoid them as much as possible. But at first, we’re supposed to know who they are.

1 Like