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

Смирнов Андрей ИТМО КТ Stage 5 #181

Merged
merged 53 commits into from
May 13, 2024

Conversation

sandrew-uj
Copy link
Contributor

No description provided.

Copy link
Contributor

@AlexeyShik AlexeyShik left a comment

Choose a reason for hiding this comment

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

Есть замечания к корректности многопоточки + в этом дз тоже нужен отчет

this.dao = new MyServerDao(dao);
this.executor = new MyExecutor(corePoolSize, availableProcessors);
this.logger = Logger.getLogger(MyServer.class.getName());
this.httpClient = HttpClient.newHttpClient();
Copy link
Contributor

Choose a reason for hiding this comment

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

На каком пуле потоков выполняются запросы к другим репликам?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

На том же, что задается вот в этой строчке
this.executor = new MyExecutor(corePoolSize, availableProcessors);

Copy link
Contributor

Choose a reason for hiding this comment

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

Но ведь при создании HttpClient в него не передается никакой executor. Соответственно, будет создан отдельный вот тут
image
Или я что-то не заметил?

};

completableResults.forEach(completableFuture -> {
var responseFuture = completableFuture.whenComplete(whenComplete);
Copy link
Contributor

Choose a reason for hiding this comment

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

На каком пуле потоков выполняется агрегация ответов от реплик?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

На том же, что задается вот в этой строчке
this.executor = new MyExecutor(corePoolSize, availableProcessors);

Copy link
Contributor

Choose a reason for hiding this comment

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

Так как в явном виде не меняется пул потоков (не передается другой executor), то будет выполняться на том же пуле потоков, что и completableResults, то есть на том же пуле, что и sendAsync, на потоках из httpClient.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 14925 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 14929 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 14616 lines exceeds the maximum allowed for the inline comments feature.

@sandrew-uj sandrew-uj requested a review from AlexeyShik May 4, 2024 18:18
Copy link
Contributor

@AlexeyShik AlexeyShik left a comment

Choose a reason for hiding this comment

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

С учетом замечаний по многопоточке поставлю 13 баллов.

this.dao = new MyServerDao(dao);
this.executor = new MyExecutor(corePoolSize, availableProcessors);
this.logger = Logger.getLogger(MyServer.class.getName());
this.httpClient = HttpClient.newHttpClient();
Copy link
Contributor

Choose a reason for hiding this comment

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

Но ведь при создании HttpClient в него не передается никакой executor. Соответственно, будет создан отдельный вот тут
image
Или я что-то не заметил?

};

completableResults.forEach(completableFuture -> {
var responseFuture = completableFuture.whenComplete(whenComplete);
Copy link
Contributor

Choose a reason for hiding this comment

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

Так как в явном виде не меняется пул потоков (не передается другой executor), то будет выполняться на том же пуле потоков, что и completableResults, то есть на том же пуле, что и sendAsync, на потоках из httpClient.

build.gradle Outdated
@@ -68,8 +68,9 @@ compileTestJava {
options.compilerArgs += ["--enable-preview"]
}

application {
mainClass = 'ru.vk.itmo.test.reference.ReferenceService'
run {
Copy link
Contributor

Choose a reason for hiding this comment

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

Надо откатить перед мерджем

Copy link
Contributor

Choose a reason for hiding this comment

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

JIT видно на профиле

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 14616 lines exceeds the maximum allowed for the inline comments feature.

Copy link
Contributor

@AlexeyShik AlexeyShik left a comment

Choose a reason for hiding this comment

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

Прошу откатить build.gradle

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 14611 lines exceeds the maximum allowed for the inline comments feature.

@AlexeyShik AlexeyShik merged commit abf1e4e into polis-vk:main May 13, 2024
2 checks passed
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.

4 participants