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

Tal Ron commented on TINKERPOP-3138:
------------------------------------

Thanks

i assume the tests always pass true/false enableCompression so there is no case 
for undefined

i use node v20.18.0.

ws version is the one coming with gremlin for gremlin 3.7.2 it's ws 8.16.0 (but 
i see 8.18 was installed in gremlin node_modules sub folder

i do see another ws version in my main node_modules folder : ws 7.5.10 which i 
beleive coming from subsciption-transport-ws and from @kuberntes/client-node 
(which bring isomorphic-ws@5.0.0 which depends on ws 7.5.10
but i believe gremlin uses it's own ws which is 8.18

> 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