Skip to content

Unmute TokenAuthIntegTests test#61714

Merged
jkakavas merged 3 commits intoelastic:masterfrom
jkakavas:fix-55816
Sep 1, 2020
Merged

Unmute TokenAuthIntegTests test#61714
jkakavas merged 3 commits intoelastic:masterfrom
jkakavas:fix-55816

Conversation

@jkakavas
Copy link
Copy Markdown
Contributor

@ywangd made an awesome analysis on why this test is failing, over
at #55816 (comment)

This change makes it so that we use the same client to perform a
refresh of a token, as we use to subsequently attempt to authenticate
with the refreshed token. This ensures the tests are failing and is
a good approximation of how we expect the same client doing the
refresh, to also perform the subsequent authentication in real life
uses.

The errors we were seeing from users have disappeared after #55114
so we deem our behavior safe.

@ywangd made an awesome analysis on why this test is failing, over
at elastic#55816 (comment)

This change makes it so that we use the same client to perform a
refresh of a token, as we use to subsequently attempt to authenticate
with the refreshed token. This ensures the tests are failing and is
a good approximation of how we expect the same client doing the
refresh, to also perform the subsequent authentication in real life
uses.

The errors we were seeing from users have dissappeared after elastic#55114
so we deem our behavior safe.
@jkakavas jkakavas added >test-failure Triaged test failures from CI :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) labels Aug 31, 2020
@jkakavas jkakavas requested a review from ywangd August 31, 2020 12:44
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-security (:Security/Authentication)

@elasticmachine elasticmachine added the Team:Security Meta label for security team label Aug 31, 2020
@jkakavas
Copy link
Copy Markdown
Contributor Author

If we feel we should look into changing the behavior, we can do that and track this in another issue while we are still running the tests as is.

Copy link
Copy Markdown
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Just writing down my reasonings for the approval:

  • For this edge case to happen, every request needs to be round-robined to different nodes, even when all requests are from the same client. This might be the case for Cloud where proxies are employed. But even then, this requires external facing network to work fast enough to beat shard sync among internal nodes. All these just sound unlikely to happen.
  • Dirty read is a more general problem. It feels unjustified to fix it for a particular use case.
  • No new failure has been reported after #55114.

So I am happy for us to refactor the test as the fix.

@jkakavas
Copy link
Copy Markdown
Contributor Author

jkakavas commented Sep 1, 2020

@elasticmachine update branch

@jkakavas jkakavas merged commit 4886342 into elastic:master Sep 1, 2020
jkakavas added a commit to jkakavas/elasticsearch that referenced this pull request Sep 3, 2020
This reverts commit 4886342.
In master, we use the rest client which round robins between
cluster nodes and thus the same client might refresh the token
in a node and then immediately attempt to authenticate against
another. Occasionally this still triggers the issue at hand.
jkakavas added a commit that referenced this pull request Sep 3, 2020
This reverts commit 4886342.
In master, we use the rest client which round robins between
cluster nodes and thus the same client might refresh the token
in a node and then immediately attempt to authenticate against
another. Occasionally this still triggers the issue at hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team >test-failure Triaged test failures from CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants