Skip to content

Java driver and gremlin server maxContentLength changes for http#2749

Merged
xiazcy merged 1 commit intoapache:master-httpfrom
andreachild:AN-2175_maxResponseContentLength
Sep 5, 2024
Merged

Java driver and gremlin server maxContentLength changes for http#2749
xiazcy merged 1 commit intoapache:master-httpfrom
andreachild:AN-2175_maxResponseContentLength

Conversation

@andreachild
Copy link
Contributor

@andreachild andreachild commented Aug 28, 2024

Java driver:

  • renamed maxContentLength to maxResponseContentLength to clarify that the check is done against the response and not the request
  • increased default value to Integer.MAX_VALUE as the size check is now done against the total http response size instead of previous web socket frame size
  • changed int to long to allow for higher max value
  • changed zero to be an acceptable value which disables the response size check

Gremlin server:

  • renamed maxContentLength to maxRequestContentLength to clarify that the check is done against the request and not the response

Feature tests were executed for java driver and pass (other GLV feature tests currently do not work for master-http branch). Manual testing of the changes were done using local gremlin-console with remote connection configured to local gremlin server.

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (master-http@9797799). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../org/apache/tinkerpop/gremlin/driver/Settings.java 66.66% 0 Missing and 1 partial ⚠️
...he/tinkerpop/gremlin/server/util/GremlinError.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##             master-http    #2749   +/-   ##
==============================================
  Coverage               ?   77.59%           
  Complexity             ?    13420           
==============================================
  Files                  ?     1021           
  Lines                  ?    58664           
  Branches               ?     6642           
==============================================
  Hits                   ?    45523           
  Misses                 ?    10910           
  Partials               ?     2231           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cole-Greer
Copy link
Contributor

Thanks @andreachild, LGTM
VOTE +1

@andreachild andreachild force-pushed the AN-2175_maxResponseContentLength branch from ec147d0 to e11d764 Compare August 28, 2024 21:15
@andreachild andreachild force-pushed the AN-2175_maxResponseContentLength branch 4 times, most recently from 4e20a0b to ba5c437 Compare August 29, 2024 22:36
|connectionPool.keyStorePassword |The password of the `keyStore` if it is password-protected. |_none_
|connectionPool.keyStoreType |`JKS` (Java 8 default) or `PKCS12` (Java 9+ default)|_none_
|connectionPool.maxContentLength |The maximum length in bytes that a message can be sent to the server. This number can be no greater than the setting of the same name in the server configuration. |65536
|connectionPool.maxResponseContentLength |The maximum length in bytes that a message can be received from the server. |`Integer.MAX_VALUE`
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be nice to just write out 2147483647 instead of Integer.MAX_VALUE. Saves people a step from having to look it up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to 2147483647

}

@Test
public void shouldSucceedIfResponseSizeLargerThanMaxResponseContentLength() throws SerializationException {
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this test is bit misleading. shouldSucceed when the assert is that an exception occurs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to 'shouldThrow'

@kenhuuu
Copy link
Contributor

kenhuuu commented Aug 30, 2024

VOTE +1

…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity.
@andreachild andreachild force-pushed the AN-2175_maxResponseContentLength branch from 5950610 to bff9c62 Compare August 30, 2024 17:47
@vkagamlyk
Copy link
Contributor

VOTE+1

@xiazcy xiazcy merged commit f01eefc into apache:master-http Sep 5, 2024
kenhuuu pushed a commit that referenced this pull request Nov 2, 2024
…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity. (#2749)
kenhuuu pushed a commit that referenced this pull request Nov 3, 2024
…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity. (#2749)
kenhuuu pushed a commit that referenced this pull request Nov 3, 2024
…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity. (#2749)
kenhuuu pushed a commit that referenced this pull request Nov 3, 2024
…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity. (#2749)
kenhuuu pushed a commit that referenced this pull request Nov 3, 2024
…hanged int to long to allow for higher max value, increased default value to Integer.MAX_VALUE as the size check is now done against the total response size instead of previous web socket frame size, and changed zero to be acceptable value which disables the response size check. Gremlin server - renamed maxContentLength to maxRequestContentLength and updated documentation for clarity. (#2749)
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.

6 participants