Skip to content

Commit

Permalink
fix threadlocal variables being allocated outside of threaded task
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Feb 8, 2024
1 parent fa51c69 commit 3411a0d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ private void reconnectOrphanedNodes() {

// reconnect unreachable nodes
var nReconnected = new AtomicInteger();
var gs = graphSearcher.get();
var v1 = vectors.get();
var v2 = vectorsCopy.get();
var connectionTargets = ConcurrentHashMap.<Integer>newKeySet();
parallelExecutor.submit(() -> IntStream.range(0, graph.getIdUpperBound()).parallel().forEach(node -> {
if (connectedNodes.get(node) || !graph.containsNode(node)) {
Expand All @@ -261,6 +258,10 @@ private void reconnectOrphanedNodes() {
// no unused candidate found -- search for more neighbors and try again
neighbors = searchPathNeighbors.get(node);
if (neighbors == null) {
var gs = graphSearcher.get();
var v1 = vectors.get();
var v2 = vectorsCopy.get();

var notSelfBits = createNotSelfBits(node);
var value = v1.vectorValue(node);
NodeSimilarity.ExactScoreFunction scoreFunction = i1 -> scoreBetween(v2.vectorValue(i1), value);
Expand Down

0 comments on commit 3411a0d

Please sign in to comment.