hazelcast-python-client icon indicating copy to clipboard operation
hazelcast-python-client copied to clipboard

Feature Request: Ability to control request timeout > 120 seconds

Open GuyPaddock opened this issue 5 years ago • 4 comments

Currently, if any request takes longer than 120 seconds, the following exception gets raised:

TimeoutError: Request timed out after 120 seconds.

This appears to be controlled by the invocation.INVOCATION_TIMEOUT constant and does not appear tunable. I see that the constructor for Invocation takes in a timeout parameter that defaults to that constant value, but as far as I can tell there's no way to get a timeout actually passed-in to the Invocation object since that's all handled under-the-hood when the client is configured.

I would love it if I could control the timeout on a per-request basis.

GuyPaddock avatar Oct 10 '18 02:10 GuyPaddock

Hi @GuyPaddock Client Properties will be available in the next release which will allow you to specify the invocation timeout like below (See #115 ) import hazelcast from hazelcast.config import ClientProperties config = hazelcast.ClientConfig() config.set_property(ClientProperties.INVOCATION_TIMEOUT_SECONDS.name, 200) client = hazelcast.HazelcastClient(config)

However, this timeout value will be used for all of the invocations. Ability to specify a timeout for each request requires an API change so I am not sure if we can implement that in the near future. @asimarslan What do you think ? Next release should be out very soon but for the time being you can use the master branch. This feature is already merged.

mdumandag avatar Oct 10 '18 05:10 mdumandag

The current solution in master sounds like it will work for my needs; being able to tune it per-request is kind of a nice-to-have but not strictly required.

Many thanks!

GuyPaddock avatar Oct 10 '18 13:10 GuyPaddock

Is is possible the have requests that wait indefinitely if the INVOCATION_TIMEOUT_SECONDS is not set? queue.take() or map.lock("foo", 200)

Has this been implemented, should this issue be closed?

Kilo59 avatar Dec 09 '19 14:12 Kilo59

Hi @Kilo59 , timeout per invocation is not implemented yet. It requires a huge API change and we tend to do these kind of changes first on the Java client and then other clients follow it. As far as I know, there is no plan to have this kind of feature on the Java client so I can say that this won't be available in the near future for the Python client.

The issue is still open because the product management team may consider prioritizing this feature if there are enough requests coming from the community.

mdumandag avatar Dec 09 '19 20:12 mdumandag