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

Nicolas KP commented on TINKERPOP-2123:
---------------------------------------

Adding the wss:// solved the issue! Thank you so much.

So the only problem is that I wasn't getting a reasonable error in 
client.open(). It seems something in the way our project is wired makes it 
timeout whenever there is an error, instead of reporting the error. But I 
realise now (after observing the behaviour in the next error) that this is due 
to our reject()s, not due to the gremlin library.

Sorry for bothering you with something so silly.

> Javascript driver connection.open() hangs
> -----------------------------------------
>
>                 Key: TINKERPOP-2123
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2123
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: javascript
>    Affects Versions: 3.3.4
>            Reporter: Nicolas KP
>            Priority: Major
>
> Hi,
> I think that 80% it's just me using the api wrong, but there's definitely a 
> catch I don't get: when I try to connect through the js api, client.open() 
> calls connection.open() which launches a promise which just waits without 
> giving any error. It doesn't matter if I give a wrong url (it should have 
> thrown an error in that case), or not, it just waits for the timeout (I've 
> tried with 5s and 100s timeouts), execution never reaches .resolve() or 
> .reject() of connection._openPromise.
> Here's a code to reproduce the issue:
> {code}
> const authenticator = new 
> gremlin.driver.auth.PlainTextSaslAuthenticator(username, password);
> const client = new gremlin.driver.Client(
> "graphgoblin.gremlin.cosmosdb.azure.com:443",
>  { "authenticator": authenticator });
> const clientSubmitTimeout = 5 * 1000;
> return await rejectOnTimeout(clientSubmitTimeout, async () => {
>       try {
>               await client.open(); //I know it's called in .submit, but I 
> added it here to test more easily which part hangs. Execution never reaches 
> the next statement
>               const result = await client.submit(gremlinQuery);
>               return result;
>          }
>       catch (err) {
>               this.log("Error from gremlin server: ", err.message || 
> err.toString());
>               throw err;
>       }
>       finally {
>               await client.close(); //maybe unnecessary?
>        }
>  });
> {code}
>  
>   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to