Refactor limithandler package
A prerequisite of #5372 (closed).
The above issue is about adding a lot of functionalities to the Gitaly limiter. Recently, all limiter logic locate in limithandler
middleware package (internal/grpc/middleware/limithandler
). Technically speaking, thispackage is not the right location. The limiters include Per-RPC concurrency limiter, Per-RPC rate limiter, and pack-objects limiter. The pack-objects limiter is not a part of gRPC middleware. We plan to create some more limiters and advance them with adaptive limiters.
This MR extracts the core limiter functionalities out of the limithandler
package. The new location for them is at internal/limiter
. The ones that belong to gRPC middleware stay intact.
Along the way, limithandler
's custom-field logger is also removed, in favor of the generic customfields
.