close
The Wayback Machine - https://web.archive.org/web/20201011040921/https://github.com/confluentinc/schema-registry/issues/902
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failover issue with schema-registry behind reverse proxy #902

Open
emasab opened this issue Oct 2, 2018 · 3 comments
Open

failover issue with schema-registry behind reverse proxy #902

emasab opened this issue Oct 2, 2018 · 3 comments

Comments

@emasab
Copy link

@emasab emasab commented Oct 2, 2018

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

@mageshn
Copy link
Member

@mageshn mageshn commented Oct 15, 2018

@emasab thanks for bringing this up. The issue you are raising should have nothing to do with a reverse proxy setup, right?

@emasab
Copy link
Author

@emasab emasab commented Oct 15, 2018

Yes, in theory if the same schema registry returns a status code different from 200 the problem happens

@emasab
Copy link
Author

@emasab emasab commented Oct 15, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.