You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2022/06/24 00:44:25 UTC
[GitHub] [tinkerpop] simonz-bq opened a new pull request, #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
simonz-bq opened a new pull request, #1736:
URL: https://github.com/apache/tinkerpop/pull/1736
The JS implementation of the websocket resolves traversal promises by waiting for either "error" (reject) or "message" (resolve or reject depending on the contained data). However, upon the connection terminating (server restart), the "close" event is fired instead, so therefore we must let all waiting response handlers on the websocket know to reject the waiting promises.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] lyndonbauto commented on a diff in pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
lyndonbauto commented on code in PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736#discussion_r908020957
##########
gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/client-tests.js:
##########
@@ -107,5 +107,48 @@ describe('Client', function () {
assert.strictEqual(output.length, 3);
assert.ok(output[0] instanceof graphModule.Vertex);
});
+
+ it("should reject pending traversal promises if connection closes", async () => {
+ const closingClient = helper.getClient('gmodern');
+ await closingClient.open();
+ const timeout = 10000;
+ const startTime = Date.now();
+ let isRejected = false;
+
+ const pending = async function submitTraversals() {
+ while (Date.now() < startTime + timeout) {
+ try {
+ await closingClient.submit(new Bytecode().addStep('V', []).addStep('tail', []));
+ } catch (e) {
+ isRejected = true;
+ return;
+ }
+ }
+ };
+ const pendingPromise = pending();
+
+ await closingClient.close();
+ await pendingPromise;
+ assert.strictEqual(isRejected, true);
+ });
+
+ it("should end streams on traversals if connection closes", async () => {
+ const closingClient = helper.getClient('gmodern');
+ await closingClient.open();
+ let isRejected = false;
+
+ const readable = client.stream('g.V().limit(3)', {}, { batchSize: 2 });
+
+ readable.on('end', () => {
+ isRejected = true;
+ });
+
+ await closingClient.close();
+ for await (const result of readable) {
+ // Consume the stream
+ }
+
+ assert.strictEqual(isRejected, true);
+ });
});
});
Review Comment:
```suggestion
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] simonz-bq commented on pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
simonz-bq commented on PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736#issuecomment-1167840603
> Thank you for the PR. Could we add a unit test which tests the driver behaviour on abrupt close of server and validates that the traversals have been correct closed? It would help us catch regressions related to close behaviour in the future.
Tests have been added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] spmallette merged pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
spmallette merged PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] lyndonbauto commented on pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
lyndonbauto commented on PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736#issuecomment-1168210410
Nice, thanks for adding this!
VOTE+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] divijvaidya commented on pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
divijvaidya commented on PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736#issuecomment-1167153506
Thank you for the PR. Could we add a unit test which tests the driver behaviour on abrupt close of server and validates that the traversals have been correct closed? It would help us catch regressions related to close behaviour in the future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tinkerpop] codecov-commenter commented on pull request #1736: TINKERPOP-2754 Fix indefinite hanging on JS client on server restart
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1736:
URL: https://github.com/apache/tinkerpop/pull/1736#issuecomment-1165990391
# [Codecov](https://codecov.io/gh/apache/tinkerpop/pull/1736?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1736](https://codecov.io/gh/apache/tinkerpop/pull/1736?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ac1f4ea) into [3.5-dev](https://codecov.io/gh/apache/tinkerpop/commit/71f3ee0ab2fec3322b3a896222ad0ccbd6c0919c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (71f3ee0) will **not change** coverage.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## 3.5-dev #1736 +/- ##
========================================
Coverage 63.51% 63.51%
========================================
Files 23 23
Lines 3601 3601
========================================
Hits 2287 2287
Misses 1136 1136
Partials 178 178
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/tinkerpop/pull/1736?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/tinkerpop/pull/1736?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [71f3ee0...ac1f4ea](https://codecov.io/gh/apache/tinkerpop/pull/1736?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org