-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response time out with client connected using unix_socket_path
when using python client but not with redis-cli
#151
Comments
Managed to isolate the instance where the above process is getting stuck. It blocks after it reads this from the buffer:
This is the value printed in the Removing the field from my query no longer blocks socket IO. Any ideas why this might be happening? Also, let me know if I should rather move this issue to the redis-py project. |
Hi @narayanacharya6 thank you for reporting! would you mind sharing a dataset with which we can reproduce this behavior? |
Hey @swilly22, due to data privacy reasons I am unable to share the data/query that led to this. I will try to reproduce this issue with dummy data and report back. Meanwhile, do you mind answering a couple of questions, which I anticipate to be the culprit (but have no proof of at the moment)?
FYI, these queries work as expected when connecting via TCP. |
Ok, I think its because of Minimal example to reproduce inspired by the getting started example here - https://docs.redis.com/latest/modules/redisgraph/redisgraph-quickstart/ is below. The only change I've introduced in the example is added
You will get a response:
The above never returns. |
This is what I'm getting on my dev machine:
Test script: import redis
from redisgraph import Graph
db_name = "MotoGP"
def query_db(connection):
graph = Graph(db_name, connection)
# query graph
q = """MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = 'Yamaha' RETURN r,t"""
result = graph.query(q)
result.pretty_print()
#-------------------------------------------------------------------------------
# form connections
#-------------------------------------------------------------------------------
# connect to database using TCP
tcp_conn = redis.Redis(host='localhost', port=6379, decode_responses=True)
# connect to database using unix-socket
unix_socket_conn = redis.Redis(host='localhost', port=6379, decode_responses=True, unix_socket_path="/tmp/redis.sock")
#-------------------------------------------------------------------------------
# populate graph
#-------------------------------------------------------------------------------
tcp_conn.flushall()
q = """CREATE (:Rider {name:'Valentino Rossi\n'})-[:rides]->(:Team {name:'Yamaha'})"""
#graph = Graph(db_name, tcp_conn)
graph = Graph(db_name, unix_socket_conn)
result = graph.query(q)
#-------------------------------------------------------------------------------
# query graph
#-------------------------------------------------------------------------------
query_db(tcp_conn)
query_db(unix_socket_conn) Results: python3 test.py
+------------------------+-----------------+
| r | t |
+------------------------+-----------------+
| {name:"Valentino Rossi | {name:"Yamaha"} |
| "} | |
+------------------------+-----------------+
Cached execution 0.0
internal execution time 0.358
+------------------------+-----------------+
| r | t |
+------------------------+-----------------+
| {name:"Valentino Rossi | {name:"Yamaha"} |
| "} | |
+------------------------+-----------------+
Cached execution 1.0
internal execution time 0.149 Both connections produce the same result-set, I'm adding @chayim to this issue maybe he'll have an idea, |
@swilly22 Installing |
Thank you @narayanacharya6 for validating this, we will look into the none |
@swilly22 For now, I can continue working with |
Response time out with client connected using
unix_socket_path
when using python client but not withredis-cli
.I have a
redis-server
instance running locally accepting connections via unix socket.redisgraph.so
was built by compiling the RedisGraph project.redis-server
was started as:I create the python client as:
My queries to construct the nodes and edges of the graph work fine. But when I try to to query for something from the constructed graph, the response never returns (partial stack trace below). When I try to run the same query from
redis-cli
(run asredis-cli -s /tmp/redis.sock
) I do get a response. Leads me to believe something in the python client is not right, maybe.Other Details:
OS version: macOS Monterey 12.0.1, Intel-based MBP (2019)
pip version of clients used:
redis-server version:
Redis server v=6.2.6 sha=00000000:0 malloc=libc bits=64 build=c6f3693d1aced7d9
redisgraph.so was built from latest master branch.
The text was updated successfully, but these errors were encountered: