-
Notifications
You must be signed in to change notification settings - Fork 912
CRT 0.4.13 API Update #1588
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
CRT 0.4.13 API Update #1588
Conversation
private final int maxConnectionsPerEndpoint; | ||
|
||
|
||
public AwsCrtAsyncHttpClient(DefaultBuilder builder, AttributeMap config) throws CrtRuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we want to declare a checked exception here?
caveat: I know very little about standards/style with Java exceptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally pulled that over as part of inlining the ClientBootstrap constructor that's since been removed. (It created the EventLoopGroup and HostResolver like I had also previously inlined.) Because they are now passed as arguments, and nothing is being added, I don't think anything is being added here that warrants in. (This is not to say that it had to be brought over in the first place.). So, I have taken it out. However, I would be open to adding it back in if there is a good argument for it!
try (EventLoopGroup elg = new EventLoopGroup(builder.eventLoopSize); | ||
HostResolver hr = new HostResolver(elg)) { | ||
|
||
bootstrap = own(new ClientBootstrap(elg, hr)); | ||
socketOptions = own(new SocketOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the elg
and hr
"try-with-resources", while the rest of the CrtResources are "owned"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't have to worry about this now that we aren't creating the EventLoopGroup or HostResolver inside of this constructor. Previously, it was because I was brining over a chunk of code from a now removed ClientBootStrap constructor that created these objects internally. Because of that, and because they were being passed to the ClientBootstrap, it didn't seem necessary to track them with "own". (But I might have been wrong!)
67bf7c4
to
f063809
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caveat: only looked at the 2 parts of code Ryan said he'd most recently touched
Factoring out EventLoopGroup/HostResolver from client constructor, fixing bug reported by Sonar
f063809
to
285e671
Compare
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## master #1588 +/- ##
============================================
+ Coverage 75.64% 75.75% +0.11%
- Complexity 638 721 +83
============================================
Files 898 903 +5
Lines 28141 28481 +340
Branches 2221 2254 +33
============================================
+ Hits 21288 21577 +289
- Misses 5836 5868 +32
- Partials 1017 1036 +19
Continue to review full report at Codecov.
|
Description
This was done by rebasing master onto crt-api-update, then rebasing crt-api-update onto aws-crt-dev-preview, making some additional changes to account for API changes, and then creating this branch. I'm open to merging this into aws-crt-dev-preview first if that's preferable to merging everything into master.
As such, there are a lot of changes here not done by myself. Only the changes done in commit 2723640 are, in that sense, actually new. More detail about those changes:
Testing
mvn clean install
[x ] I confirm that this pull request can be released under the Apache 2 license