memgraph / pymgclient

Python Memgraph Client
https://memgraph.github.io/pymgclient/
Apache License 2.0
43 stars 6 forks source link

Blocking behavior of pymgclient #59

Open cloudcell opened 1 year ago

cloudcell commented 1 year ago

It appears that pymgclient's behavior is different from neo4j's library in a way that pymgclient blocks all operations of an app until the cypher query is completely performed. Would it be possible to use async withingn pymgclient (if neo4j uses async, as we suspect)?

antejavor commented 1 year ago

Related to the discussion on Discord: https://discord.com/channels/842007348272169002/890968055339958292/1147113765716893777

cloudcell commented 1 year ago

Here is some more context. To replicate the issue please create a simple flask app that would run a query and create an endpoint that responds to another query, say, fetching a file from a server. So, the issue appears that when one runs gunicorn -w 1 -b 127.0.0.1:5432 script:app -- the app does not work properly during query processing but when one runs gunicorn -w 2 -b 127.0.0.1:5432 script:app -- the app does run properly (i.e. can run the cypher query and fetch a file from a server simultaneously)

This behavior does not appear when using neo4j, but only when using pymgclient. What this means is that when one is using pymgclient, there needs to be a second worker to process other requests to the server as pymgclient appears to block the worker.

katarinasupe commented 8 months ago

Hi @cloudcell, so sorry we didn't attend to this sooner. Can you tell me if this is a blocking issue for you and how this affects your project currently?

cloudcell commented 8 months ago

Hi Katarina,

I believe we found some workaround. TBH, it's been so long ago I can hardly remember the context at this particular moment. It was too technical. IIRC, there was a general block of the process compared to the lack thereof when working with neo4j...

Regards, Alex.

On Sat, Dec 30, 2023 at 5:02 AM Katarina Supe @.***> wrote:

Hi @cloudcell https://github.com/cloudcell, so sorry we didn't attend to this sooner. Can you tell me if this is a blocking issue for you and how this affects your project currently?

— Reply to this email directly, view it on GitHub https://github.com/memgraph/pymgclient/issues/59#issuecomment-1872189793, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6VI4U5JCGS3ZKAEEZKFS3YL3SS5AVCNFSM6AAAAAA4KDU4JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGE4DSNZZGM . You are receiving this because you were mentioned.Message ID: @.***>

katarinasupe commented 8 months ago

Hi @cloudcell, thank you for the response. I'm glad to hear you found a workaround. If you have another issue, please open it here on GitHub or hop on a call with us to discuss more (maybe we can help).