lplalbert commented on code in PR #424:
URL: https://github.com/apache/hugegraph-ai/pull/424#discussion_r4581502989
##########
hugegraph-llm/src/hugegraph_llm/operators/index_op/build_semantic_index.py:
##########
@@ -68,7 +48,7 @@ def run(self, context: Dict[str, Any]) -> Dict[str, Any]:
if added_vids:
vids_to_process = self._extract_names(added_vids) if all_pk_flag
else added_vids
- added_embeddings =
asyncio.run(self._get_embeddings_parallel(vids_to_process))
+ added_embeddings =
asyncio.run(get_embeddings_parallel(self.embedding, vids_to_process))
Review Comment:
Root cause: the shared fetch ran every batch through , so the instance-owned
async client (and its pooled keep-alive connections) outlived the per-update
loop that creates and closes. The same failure applied to all three consumers
of the helper (, , ).
Structural fix (0722aac): retained the synchronous executor path. Each batch
now runs on the loop's executor — the route used before this PR. The
synchronous clients hold no loop-bound state, so client and loop lifetimes no
longer need to match across updates. Order, batching (500) and the in-flight
bound (10) are unchanged; the async fetch methods stay on the embedding API for
direct use.
Validation:
- : two nonempty updates on one instance through the real helper. Red
before 0722aac with on the second update; both updates now index their new
vertices. The embedding fake reproduces the reported lifecycle (one pooled
connection bound to the loop that first used it) — it models the transport
binding, not a live HTTP keep-alive exchange, so it does not establish
real-client behavior.
- pins the fetch to the sync client.
- Full suite: 1292 passed, 12 skipped, 2 failed — the same two pre-existing
Windows mode-bit failures as on main. / clean on touched files; 265
diagnostics before and after (zero new).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]