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

Remove CompletableFuture from SSLConfigurationReloader #93132

Conversation

DaveCTurner
Copy link
Contributor

@DaveCTurner DaveCTurner commented Jan 23, 2023

Replaced with a PlainActionFuture, since it is never completed exceptionally.

The `SSLConfigurationReloader` uses a `CompletableFuture` to receive an
as-yet-unconstructed instance of the `SSLService`, but in all cases the
`SSLService` is in fact already constructed so we can just directly pass
it into the constructor.
@DaveCTurner DaveCTurner added >non-issue :Security/Security Security issues without another label v8.7.0 labels Jan 23, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Jan 23, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@ywangd
Copy link
Member

ywangd commented Jan 23, 2023

@DaveCTurner I think this could potentially re-introduce the issue fixed by #54999 (see also #54867). In summary, the use of the future isn't because SslService being unavailable but to ensure update to relevant SSL files are always handled.

@DaveCTurner
Copy link
Contributor Author

I see. This is pretty trappy, and doesn't seem to be covered by a test? Even a comment would have helped. Ok, I'll do something different here.

@DaveCTurner DaveCTurner requested a review from ywangd January 24, 2023 08:14
@DaveCTurner
Copy link
Contributor Author

Thanks @ywangd, this is ready for another look

Copy link
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

This is pretty trappy, and doesn't seem to be covered by a test? Even a comment would have helped.

Yeah I agree a comment would have been good. It does have a test. But due to the racing nature and how close the two statements are at each other (with no place to inject something in between), it happens only very rarely so that the test is not guaranteed to fail when the main code changes. It's more of a best effort.

@DaveCTurner
Copy link
Contributor Author

👍 I see, thanks Yang

@DaveCTurner DaveCTurner merged commit 30ae87c into elastic:main Jan 25, 2023
@DaveCTurner DaveCTurner deleted the 2023-01-23-SSLConfigurationReloader-CompletableFuture branch January 25, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Security/Security Security issues without another label Team:Security Meta label for security team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants