You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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::timeout to 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)
The text was updated successfully, but these errors were encountered:
Description:
We have started to make queries to the
get_from_graph
function in thePostStream
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:
Requirements:
tokio::time::timeout
to limit query execution time.The text was updated successfully, but these errors were encountered: