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

Fix #2785: Support optionally disabling pipelining on AUTH flow #2787

Closed
wants to merge 4 commits into from

Conversation

dbarbosapn
Copy link
Contributor

resolves #2785

This PR is (for now) an initial proposal for fixing the issue mentioned above.
With the new external authentication feature of Envoy, pipelining AUTH with further commands can cause unexpected behavior where we see +OK for AUTH, followed by NOAUTH for the critical trace.

We fix this by adding an optional ConfigurationOptions flag that disables this behaviour.

@mgravell
Copy link
Collaborator

mgravell commented Sep 5, 2024

So my random idea of a bug in envoy pipelining support was correct? If so, the "correct" fix here should be squarely inside envoy. I'll have a look at this and see if I can find any concerning side-effects, but: they could be subtle.

@dbarbosapn
Copy link
Contributor Author

dbarbosapn commented Sep 5, 2024

So my random idea of a bug in envoy pipelining support was correct? If so, the "correct" fix here should be squarely inside envoy. I'll have a look at this and see if I can find any concerning side-effects, but: they could be subtle.

Envoy supports pipelining but this new feature doesn't since it calls a gRPC dependency (asynchronous) to validate the AUTH result. Would you say it makes more sense to make such call synchronous on Envoy side? I imagine it would have more performance implications... I would guess it would be best for that to be on client-side, which shouldn't be a big issue since it will just await the result of AUTH before proceeding, but doesn't hang any thread.

WDYT?

@mgravell
Copy link
Collaborator

mgravell commented Sep 5, 2024

It doesn't need to be synchronous per-se, but they can't go and process other commands while it is pending. If the problem is that envoy is implemented using thread-per-connection, then yes: it probably needs to be synchronous or effectively synchronous, since they can't meaningfully process anything else on that connection until the external result is known. So in that context: there's nothing to lose by making it synchronous (or in async terms; they need to await the gRPC call before processing anything else on that same connection).

@dbarbosapn
Copy link
Contributor Author

It doesn't need to be synchronous per-se, but they can't go and process other commands while it is pending. If the problem is that envoy is implemented using thread-per-connection, then yes: it probably needs to be synchronous or effectively synchronous, since they can't meaningfully process anything else on that connection until the external result is known. So in that context: there's nothing to lose by making it synchronous (or in async terms; they need to await the gRPC call before processing anything else on that same connection).

Thank you! Will investigate on Envoy side and come back with a result on the issue ticket. I'll close the PR for now. Thanks!

@dbarbosapn dbarbosapn closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipelining causes NOAUTH errors with External Authentication on Envoy
2 participants