sozu-proxy / sozu

Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome!
https://www.sozu.io/
GNU Affero General Public License v3.0
3.12k stars 193 forks source link

workers return only one response when dispatching a request #1052

Closed Keksoj closed 11 months ago

Keksoj commented 11 months ago

In a Sōzu worker, there are 3 proxies: an HTTP, HTTPS and TCP one. Some requests, like AddCluster, are dispatched to all of them, which causes three distinct WorkerResponses to be sent back to the main process. Only one of those is recognized by the main process, while the others get logged as:

2023-12-12T09:20:17.927059Z 1702372817927059726 38782 MAIN DEBUG    sozu::command   unknown response id: CONFIG-5
2023-12-12T09:20:17.927098Z 1702372817927098916 38782 MAIN DEBUG    sozu::command   unknown response id: CONFIG-5

Which confuses the user, pollutes the logs and takes up ressources.

This PR fixes it by returning only one response of the two or three available. A Failure response will override an OK by another proxy.