pymgclient icon indicating copy to clipboard operation
pymgclient copied to clipboard

Blocking behavior of pymgclient

Open cloudcell opened this issue 2 years ago • 5 comments

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)?

cloudcell avatar Sep 04 '23 09:09 cloudcell

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

antejavor avatar Sep 04 '23 09:09 antejavor

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.

cloudcell avatar Sep 04 '23 09:09 cloudcell

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?

katarinasupe avatar Dec 29 '23 16:12 katarinasupe

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: @.***>

cloudcell avatar Dec 29 '23 18:12 cloudcell

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).

katarinasupe avatar Jan 08 '24 08:01 katarinasupe