A problem has been highlighted where variables have been unbound where they should have been bound.
This may be traced to an implementation problem with ConcurrentWeakValueHashMap putIfAbsent method.
This issue was finally identified when two distinct instances of Var were obtained from Var.var(String) for the same variable name leading to an unconstrained cross product join since the variable in the query did not match the variable in the binding set. This probably arose when an old weak reference for a variable was clear simultaneous with the creation by two threads of distinct Var instances for the same variable name that was recently cleared from the CWVHM.
Note: This may also be responsible for a condition reported by one customer where a variable would sometimes not have a binding in a SPARQL result.
Note: We have not been able to create a test that reliably demonstrates the underlying failure. However, failures have occasionally been observed by repeated runs of TestVar.