Tal Ron created TINKERPOP-3138:
----------------------------------
Summary: JS gremlin library "enableCompression" option cause
Connection the b closed
Key: TINKERPOP-3138
URL: https://issues.apache.org/jira/browse/TINKERPOP-3138
Project: TinkerPop
Issue Type: Bug
Components: driver, javascript
Affects Versions: 3.7.3, 3.6.8
Reporter: Tal Ron
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)