Github user FlorianHockmann commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/712#discussion_r141104538
--- Diff: gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bytecode.cs ---
@@ -79,7 +85,77 @@ public void AddSource(string sourceName, params object[]
args)
/// <param name="args">The traversal method arguments.</param>
public void AddStep(string stepName, params object[] args)
{
- StepInstructions.Add(new Instruction(stepName, args));
+ StepInstructions.Add(new Instruction(stepName,
FlattenArguments(args)));
+ Bindings.Clear();
--- End diff --
This is definitely a problem, but do you see a way to fix it?
Unfortunately, I think we have to use `static` here unless we want to create
overloads for each parameter in the Traversal API that takes a `Binding`
instead of the unbound variable which would result in a lot of overloads.
Since [`Bindings` don't seem to improve the performance with
Bytecode](https://lists.apache.org/thread.html/c10baff72e67a8b7728c42b5c4e983a83e82b8f6964b3aa465f0e341@<dev.tinkerpop.apache.org>)
when no lambdas are used which we don't support anyway, we may also remove the
support for `Bindings` altogether from Gremlin.Net. Then we also don't need the
`FlattenArguments` and `ConvertArgument` functions in `Bytecode` which are not
exactly intuitive.
Or if we want to continue supporting them, we could also add a note to the
documentation to make users aware of these concurrency problems with `Bindings`.
---