zero icon indicating copy to clipboard operation
zero copied to clipboard

zmq.error.Again: Resource temporarily unavailable

Open acewhitegui opened this issue 3 years ago • 9 comments

Hi,I'm using zeroapi in kubernates and I get an annoying issues:

image

And the issues happened randomly. my zmq version is pyzmq-22.3.0. Could you please help me how to solve my problems?

acewhitegui avatar Apr 01 '22 12:04 acewhitegui

There is a timeout parameter in the client, the default is 2000ms (2s) https://github.com/Ananto30/zero/blob/main/zero/client.py#L42

If you think your program can take more time (seems like from your error), please set the timeout while creating the client like this -

client = ZeroClient("<HOST>", 8000, default_timeout=10000)

Ananto30 avatar Apr 02 '22 05:04 Ananto30

There is a timeout parameter in the client, the default is 2000ms (2s) https://github.com/Ananto30/zero/blob/main/zero/client.py#L42

If you think your program can take more time (seems like from your error), please set the timeout while creating the client like this -

client = ZeroClient("<HOST>", 8000, default_timeout=10000)

Thanks to reply.And I had set the timeout parameter like this: image

Is there another possible reason to cause this issues?

acewhitegui avatar Apr 06 '22 02:04 acewhitegui

Are you facing the issue even after setting the timeout?

Ananto30 avatar Apr 06 '22 02:04 Ananto30

Are you facing the issue even after setting the timeout?

Yes.

acewhitegui avatar Apr 06 '22 04:04 acewhitegui

I need to test this thoroughly. From my point of view, it was only happening for the timeouts.

Add test for timeout and "Resource temporarily unavailable".

Ananto30 avatar Apr 06 '22 05:04 Ananto30

Hi,Is there something I can help to do? By the way,my app started flask server and rpc server at the same time.May this be a reason to cause the issue?

acewhitegui avatar Apr 07 '22 10:04 acewhitegui

It would be really amazing if you can help on the above issue #12 :pray: I couldn't manage time yet.

Btw how are you running two servers at the same time? Are you using a process manager like supervisord?

Ananto30 avatar Apr 07 '22 13:04 Ananto30

It would be really amazing if you can help on the above issue #12 🙏 I couldn't manage time yet.

Btw how are you running two servers at the same time? Are you using a process manager like supervisord?

Yes.I start rpc server on main thread and flask server on fork thread.

acewhitegui avatar Apr 08 '22 13:04 acewhitegui

Yes.I start rpc server on main thread and flask server on fork thread.

Then you use the zero client inside the function of flask server?

Ananto30 avatar Apr 11 '22 09:04 Ananto30

@ACEGuiPeng any update on this? Or I will close the issue as solved.

Ananto30 avatar Oct 23 '22 11:10 Ananto30

Usually happens for timeout issues, otherwise connection issues. So I made two different ZeroExceptions - TimeoutException and ConnectionException in this pr https://github.com/Ananto30/zero/pull/29

Ananto30 avatar Mar 26 '23 11:03 Ananto30