hyman-m/balancer

Does the HTTPProxy structure require the mutex?

Closed this issue · 0 comments

Hi! I think this field don't need. First of all, each url corresponds to several servers, and these mapping relationships are stored in each httpproxy pointer. In the process of reading the source code, I found that this field (mutex) will only be used in the health check concurrency, but after a little thinking, any two different urls will not appear data race. Because the location of the stored mapping relationship is not the same; For the same url, the only possible data race will occur if there is a duplicate in the server, but this request should be illegal, you can directly check when reading yaml file, then you can not need mutex field.
Of course, this field don't effect system operation.