[ https://issues.apache.org/jira/browse/TINKERPOP-3138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17934655#comment-17934655 ]
Andrea C commented on TINKERPOP-3138: ------------------------------------- I tested execution of default `enableCompression` using the connections.js example (using node 20.18.0) in the against 3.7.4 gremlin-server docker container and while you're correct in that the default value is undefined and not false I don't receive any connection-related errors. See the example here: [https://github.com/apache/tinkerpop/blob/3.7-dev/gremlin-javascript/examples/node/connections.js] I would be curious to see the configuration yaml file you are using for your gremlin-server. I do not believe the original intent of the addition of the `enableCompression` setting was to change the default behaviour. It would make sense to me to have this setting default changed to `true` instead of undefined as it is now. > 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)