Skip to content

2.1.8 PR#9

Open
gurudevtest wants to merge 294 commits into2.1.8from
master
Open

2.1.8 PR#9
gurudevtest wants to merge 294 commits into2.1.8from
master

Conversation

@gurudevtest
Copy link
Contributor

No description provided.

carl-mastrangelo and others added 30 commits April 15, 2020 10:55
…ing generated Java files. (#791)

While Gradle worked fine with the existing code, IntelliJ does not.  IntelliJ's
incremental compilation does not include the full classpath, making most of the
files in the Filter class not available.  The generated file thus changes frequently
and prevents running from the IDE.   JetBrains considers this a feature, and will
not change it.

Work around this by generating a list of classes, which is appended, rather than
created from scratch each compilation.  This allows incremental compilation in
IntelliJ to keep running at the cost of potentially having stale filters listed.
Travis CI made a change in how it pulls git repos, which no longer includes all tags.  This means the version can't be inferred, causing releases and snapshots to use version 0.0.1.   Pin the version for now, which is how other OSS projects work.
make use of adjust retry policy method before retrying
add ability to provide headers on request rejection
carl-mastrangelo and others added 27 commits March 31, 2021 10:05
* build(deps): bump actions/setup-java from v1 to v2

Bumps [actions/setup-java](https://github.com/actions/setup-java) from v1 to v2.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v1...8764a52)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix PR to include required field

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carl Mastrangelo <cmastrangelo@netflix.com>
Bumps [actions/cache](https://github.com/actions/cache) from v2 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](actions/cache@v2...26968a0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Simplify read timeout functionality and move to using Duration
This PR changes LOG.warn to LOG.debug in ClientResponseWriter

Motivation:

We have observed a large number of WARN messages in production.
The log message that occurs most frequently is

  Received complete event while still handling the request. With reason: CLOSE
* Tests for completion event reason
Fix potential NPE in ProxyEndpoint
This is needed to run on later JDKs than 11, as it uses a better maintained classfile generator.   From my reading, it is API compatible with Guice 4.2.
Copy link
Contributor Author

@gurudevtest gurudevtest left a comment

Choose a reason for hiding this comment

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

We identified new issues on unchanged lines of code. Navigate to the Amazon CodeGuru Reviewer console to view the recommendations to fix them.

static Map<NamedSocketAddress, ChannelInitializer<?>> convertPortMap(
Map<Integer, ChannelInitializer<?>> portsToChannelInitializers) {
Map<SocketAddress, ChannelInitializer<?>> addrsToInitializers =
Map<NamedSocketAddress, ChannelInitializer<?>> addrsToInitializers =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

The HashMap constructor rehashes your hash table after 75% of all keys have been added to the table. To improve performance and prevent rehashing, use the Guava newHashMapWithExpectedSize() method. See the following diffs on GitHub that make this code change: diff1, diff2

Learn more: HashMap constructor in the Java Platform Standard Edition 8 API Specification and the newHashMapWithExpectedSize in the Guava: Google Core Libraries for Java 23.0 API

static final Attrs.Key<Integer> HAPM_DEST_PORT = Attrs.newKey("hapm_port");

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

This method contains 47 lines of code, not including blank lines or lines with only comments, Java punctuation characters, identifiers, or literals. By comparison, 98% of the methods in the CodeGuru reference dataset contain fewer lines of code. Large methods might be difficult to read and have logic that is hard to understand and test. We recommend that you simplify this method or break it into multiple methods.

* </ul>
*/
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

The cyclomatic complexity of this method is 13. By comparison, 98% of the methods in the CodeGuru reference dataset have a lower cyclomatic complexity. This indicates the method has a high number of decisions and it can make the logic difficult to understand and test.

We recommend that you simplify this method or break it into multiple methods. For example, consider extracting the code block on lines 74-82 into a separate method.

* @param rejectedBody the HTTP body to be sent back. It is assumed to be of type text/plain.
* @param rejectionHeaders additional HTTP headers to add to the rejection response
*/
public static void handleRejection(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

The cyclomatic complexity of this method is 12. By comparison, 98% of the methods in the CodeGuru reference dataset have a lower cyclomatic complexity. This indicates the method has a high number of decisions and it can make the logic difficult to understand and test.

We recommend that you simplify this method or break it into multiple methods. For example, consider extracting the code block on lines 167-178 into a separate method.

Copy link
Contributor

@Vishnu-Amazon Vishnu-Amazon left a comment

Choose a reason for hiding this comment

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

We identified new issues on unchanged lines of code. Navigate to the Amazon CodeGuru Reviewer console to view the recommendations to fix them.

Copy link
Contributor Author

@gurudevtest gurudevtest left a comment

Choose a reason for hiding this comment

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

We identified new issues on unchanged lines of code. Navigate to the Amazon CodeGuru Reviewer console to view the recommendations to fix them.

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.