-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
📈 enhancementNew feature or requestNew feature or request🔮 nexusGeneral system changesGeneral system changes
Description
Description:
We have started to make queries to the get_from_graph function in the PostStream model. it fetches posts streams from Neo4J without a timeout. Right now it is super fast, but as the network grows some queries will take longer. We need to introduce timeout handling to ensure that long-running queries do not affect the performance and responsiveness of the system.
Why This Is Needed:
- Prevent Long-Running Queries: Large or complex queries can hang, blocking resources.
- Maintain Responsiveness: Timeout ensures the application remains responsive under high load.
- Better Error Handling: Gracefully handle long-running queries by returning a timeout error.
Requirements:
- Use
tokio::time::timeoutto limit query execution time. - Ensure the Neo4J query is canceled if the timeout is exceeded.
- Investigate Neo4J’s support for canceling timed-out queries. Per query timeout might be possible with apoc? . We can only use a global setting for timeout. That would make bigger queries difficult as well (e.g. reindexing will take long but we do not care so much).
CALL apoc.cypher.runTimeboxed("MATCH (n:Person{name:'Keanu Reeves'})-[*]-(other)
RETURN count(*) as allPathsCount",
{}, 20000)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
📈 enhancementNew feature or requestNew feature or request🔮 nexusGeneral system changesGeneral system changes