Hi Ismael,

Thank you for reviewing the KIP.

An authenticated client that is not authorized to access a topic is never
told that the operation was not authorized. This is to prevent the client
from finding out if the topic exists by sending an unauthorized request. So
in this case, the client will retry metadata requests with the configured
backoff until it times out. Another important distinction for authorization
failures is that the connection is not terminated.

For unauthenticated clients, we do want to inform the client that
authentication failed. The connection is terminated by the broker.
Especially if the client is using SASL_SSL, we really do want to avoid
reconnections that result in unnecessary expensive handshakes. So we want
to return an exception to the user with minimal retries.

I was thinking that it may be useful to try more than one broker for the
case where brokers are being upgraded and some brokers haven't yet seen the
latest credentials. I suppose I was thinking that at the moment we keep on
retrying every broker forever in the consumer and suddenly if we stop
retrying altogether, it could potentially lead to some unforeseen timing
issues. Hence the suggestion to try every broker once.

Yes, I agree that blacking out nodes forever isn't a good idea. When we
throw AuthenticationFailedException for the current operation or if
authentication to another broker succeeds, we can clear the blackout so
that any new request from the client can attempt reconnection after the
reconnect backoff period as they do now.

Regards,

Rajini

On Thu, May 4, 2017 at 12:51 PM, Ismael Juma <ism...@juma.me.uk> wrote:

> Thanks Rajini. This is a good improvement. One question, the proposal
> states:
>
> Producer waitForMetadata and consumer ensureCoordinatorReady will be
> > updated to throw AuthenticationFailedException if connections to all
> > available brokers fail authentication.
>
>
> Can you elaborate on the reason why we would treat authentication failures
> differently from authorization failures? It would be good to understand
> under which scenario it would be beneficial to try all the brokers (it
> seems that the proposal also suggests blacking out brokers permanently if
> we fail authentication, so that could also eventually cause issues).
>
> Ismael
>
>
> On Thu, May 4, 2017 at 12:37 PM, Rajini Sivaram <rajinisiva...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > I have created a KIP to improve diagnostics for SASL authentication
> > failures and reduce retries and blocking when authentication fails:
> >
> > https://cwiki.apache.org/confluence/display/KAFKA/KIP-152+-+
> > Improve+diagnostics+for+SASL+authentication+failures
> >
> > Comments and suggestions are welcome.
> >
> > Thank you...
> >
> > Regards,
> >
> > Rajini
> >
>

Reply via email to