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

Add option for downloader to listen on unix socket #2102

Merged
merged 7 commits into from
Jun 11, 2020
Merged

Conversation

ssalinas
Copy link
Member

Gives the ability to better lock down the s3 downloader. If a unix socket is set in the base configuration, the downloader will listen on the given socket and the executor will use that to trigger downloads.

  • The S3Downloader can listen on both http + unix socket
  • Executor prefers unix socket if set

Still need to test

@ssalinas ssalinas added the hs_qa label Jun 11, 2020
Copy link
Contributor

@WH77 WH77 left a comment

Choose a reason for hiding this comment

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

few comments, but otherwise looks good to 🚢


if (s3Configuration.getLocalDownloadSocket().isPresent()) {
UnixSocketConnector unix = new UnixSocketConnector(server);
unix.setAcceptQueueSize(128);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if you want to read this from /proc/sys/net/core/somaxconn or otherwise provide a way to override this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, will make it a configurable value for the moment

server.addConnector(http);
}

if (s3Configuration.getLocalDownloadSocket().isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this is an if+if instead of an if+else so that http can be used as a fallback for unix sockets?

Copy link
Member Author

Choose a reason for hiding this comment

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

if + if, both can be enabled at once (for ease of migration over to the new one)

this.s3Artifact = s3Artifact;
}

public ContentResponse getReponse() throws InterruptedException {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - spelling

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, will fix

SingularityExecutorTask task
)
throws InterruptedException {
final List<CompletableFutureHolder> futures = Lists.newArrayListWithCapacity(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could possibly refactor the two local download fetchers into a single implementation that takes in an S3Artifact -> CompletableFuture function, if you think consolidating the implementations is worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The ning async client works with the other futures by default. Didn't want to mess with the existing/working code as much as possible for the moment. Agree CompletableFuture is much nicer though

Copy link
Contributor

@WH77 WH77 left a comment

Choose a reason for hiding this comment

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

🚢

@ssalinas ssalinas merged commit 95af5b8 into master Jun 11, 2020
@ssalinas ssalinas deleted the downloader_perms branch June 11, 2020 19:33
@ssalinas ssalinas added this to the 1.3.0 milestone Sep 24, 2020
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.

None yet

2 participants