failover issue with schema-registry behind reverse proxy
Hi, I've noticed that when the schema registry is behind a reverse proxy like nginx and we have configured multiple schema registry url like
schema.registry.url=http://x.x.x.1/api/schema-registry/,http://x.x.x.2/api/schema-registry/,http://x.x.x.3/api/schema-registry/
if the first schema registry is down the reverse proxy return 502 Bad Gateway, the schema registry client doesn't continue with trying the other urls, but throws a RestClientException. This is because at RestService.httpRequest the RestClientException is not caught
} catch (IOException e) {
baseUrls.fail(baseUrl);
if (i == n - 1) {
throw e; // Raise the exception since we have no more urls to try
}
}
Was this intented as is or can be fixed?
Thanks
@emasab thanks for bringing this up. The issue you are raising should have nothing to do with a reverse proxy setup, right?
Yes, in theory if the same schema registry returns a status code different from 200 the problem happens
It depends, if the error returned by the schema registry is something that will happen on the other nodes too, it should not retry, but in cases like this where the problem is only on one node, it should
For example it could failover with a 5xx status code or return the error immediately with a 4xx
More specifically, it could failover in case of IOException like now or if it cannot parse the response to an ErrorMessage and the error is an 5xx
@emasab how to reproduce this?