mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
* fix: prevent duplicate dispatcher creation race condition in invoke_global_service Concurrent coroutines could all pass the `if key in self.dispatchers` check before any of them wrote the result back, because `await dispatcher.start()` yields to the event loop. This caused multiple Pulsar consumers to be created on the same shared subscription, distributing responses round-robin and dropping ~2/3 of them — manifesting as a permanent spinner in the Workbench UI. Apply a double-checked asyncio.Lock in both `invoke_global_service` and `invoke_flow_service` so only one dispatcher is ever created per service key. * test: add concurrent-dispatch tests for race condition fix Add asyncio.gather-based tests that verify invoke_global_service and invoke_flow_service create exactly one dispatcher under concurrent calls, preventing the duplicate Pulsar consumer bug. |
||
|---|---|---|
| .. | ||
| test_agent | ||
| test_base | ||
| test_chunking | ||
| test_cli | ||
| test_clients | ||
| test_concurrency | ||
| test_config | ||
| test_cores | ||
| test_decoding | ||
| test_direct | ||
| test_embeddings | ||
| test_extract | ||
| test_gateway | ||
| test_knowledge_graph | ||
| test_librarian | ||
| test_provenance | ||
| test_pubsub | ||
| test_query | ||
| test_rdf | ||
| test_reliability | ||
| test_retrieval | ||
| test_rev_gateway | ||
| test_storage | ||
| test_structured_data | ||
| test_text_completion | ||
| __init__.py | ||
| test_prompt_manager.py | ||
| test_prompt_manager_edge_cases.py | ||
| test_python_api_client.py | ||