Skip to content

TINKERPOP-3063 Fix bug in Gremlin.Net authentication for parallel requests#2522

Closed
FlorianHockmann wants to merge 1 commit into
3.6-devfrom
TINKERPOP-3063
Closed

TINKERPOP-3063 Fix bug in Gremlin.Net authentication for parallel requests#2522
FlorianHockmann wants to merge 1 commit into
3.6-devfrom
TINKERPOP-3063

Conversation

@FlorianHockmann

Copy link
Copy Markdown
Member

https://issues.apache.org/jira/browse/TINKERPOP-3063

Executing multiple queries in parallel could lead to authentication failures if MaxInProcessPerConnection is set to a value higher than 1 as the second request could then be sent to the server while the server was still waiting for the authentication challenge response from the driver for the first query.

This made it necessary to set MaxInProcessPerConnection=1 as a workaround for such scenarios which of course means that connection pooling is less efficient.

Simply sending a validation request on each connection right after establishing the connection and therefore before it can be used to submit queries from the user should fix this issue. The downside of this is of course that connection establishment takes slightly longer. I think this is an acceptable trade-off even for scenarios where authentication is not used since this also validates the connection irrespective of authentication and also because this delay only occurs once right at the start of an application.

VOTE +1

Executing multiple queries in parallel could lead to authentication
failures if `MaxInProcessPerConnection` is set to a value higher than
`1` as the second request could then be sent to the server while the
server was still waiting for the authentication challenge response from
the driver for the first query.

This made it necessary to set `MaxInProcessPerConnection=1` as a
workaround for such scenarios which of course means that connection
pooling is less efficient.

Simply sending a validation request on each connection right after
establishing the connection and therefore before it can be used to
submit queries from the user should fix this issue.
The downside of this is of course that connection establishment takes
slightly longer. I think this is an acceptable trade-off even for
scenarios where authentication is not used since this also validates the
connection irrespective of authentication and also because this delay
only occurs once right at the start of an application.
@Cole-Greer

Copy link
Copy Markdown
Contributor

@FlorianHockmann Do you have any thoughts on the server side solution by @tien in #2525? If the server fix fully addresses the issue, then it should make the changes here as well as equivalent GLV changes unnecessary.

@FlorianHockmann

Copy link
Copy Markdown
Member Author

Do you have any thoughts on the server side solution by @tien in #2525? If the server fix fully addresses the issue, then it should make the changes here as well as equivalent GLV changes unnecessary.

I'm just back from vacation which is why I couldn't review the PR yet.
But I agree in general that a server fix is definitely better in general than implementing workarounds in all GLV drivers. I'll try to review #2525 today.
If it fixes the issue, then we of course don't need this PR any more.

@FlorianHockmann

Copy link
Copy Markdown
Member Author

Closing this as it was superseded by #2525 which fixes the problem on the server side so the workaround I implemented here for the .NET driver isn't needed any more.

@FlorianHockmann FlorianHockmann deleted the TINKERPOP-3063 branch April 9, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants