[ 
https://issues.apache.org/jira/browse/TINKERPOP-3138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17934036#comment-17934036
 ] 

Andrea C commented on TINKERPOP-3138:
-------------------------------------

Hi [~talron] thanks for the detailed analysis of this issue. By just looking at 
the code it does seem like the default value for `enableCompression` is 
undefined and not `false` as you have seen in your troubleshooting. I am 
curious why the test for the exact scenario passes in 
`client-behavior-tests.js`:

```
it('should not request permessage deflate compression by default', async 
function () {
const result = await client.submit('1', null, \{requestId: 
settings.SEC_WEBSOCKET_EXTENSIONS});
const returnedExtensions = result.first()
assert.ok(returnedExtensions == undefined || 
!returnedExtensions.includes("permessage-deflate;"))
});
```
 
The `enableCompression` configuration was removed in master branch as TinkerPop 
4.0 will no longer support web sockets (http only).
 
I hope to try to reproduce the issue and troubleshoot sometime this week.
 

 

> JS gremlin library "enableCompression" option cause Connection the be closed
> ----------------------------------------------------------------------------
>
>                 Key: TINKERPOP-3138
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3138
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver, javascript
>    Affects Versions: 3.6.8, 3.7.3
>            Reporter: Tal Ron
>            Priority: Major
>
> JS gremlin lib version 3.6.8 added "enableCompression" option to 
> DriverRemoteConnection. 
> according to docs the default is false.
> our project is running over 1k unit tests which worked fine until and 
> including version 3.6.7.
> running our ut against tinkerpop server 3.6.8 and gremlin 3.6.8 started 
> producing errors such as "Connection has been closed" and various errors 
> related to empty/undefined results returned from server (this is more hard to 
> pinpoint where the issue lies)
> we've tried to run gremlin client lib 3.6.7 against tinkerpop server 3.6.8 
> and it worked fine
> so we assumed issue was with 3.6.8 client lib.
> after some investigation we pinpoint the issue to addition of 
> enableCompression in client.js
> *@param \{Boolean} [options.enableCompression] Enable per-message deflate 
> compression. Defaults to: false*
> this option (related to perMessageDeflate) is passed to the ws class which 
> has 
> perMessageDeflate: true by default. passing an undefined value for 
> 'enableCompression' (which is the default and not false from my testing) 
> cause the server to disconnect and returns empty results. maybe an undefined 
> value (true value overridden by the undefined "default" option value) for  
> perMessageDeflate passed to ws lib might cause this
> if i pass enableCompression: false in the driver options, this exhibit the 
> same issue. passing enableCompression: true works fine.
> if we comment the line passed to ws in connection.js
> *perMessageDeflate: this.options.enableCompression,*
> all works fine
> this has the same issue also in version 3.7.3 as it included 3.6.8 code.
> i did see a commit revert for this changes to the *4.0.0-beta.1* branch:
> [https://github.com/apache/tinkerpop/commit/6fccb0df4847b13773547406a04f593b3e94e95d]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to