Skip to content
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

Issue-2011 - Set configuration for readtimeout and set timeout on ES … #2018

Open
wants to merge 2 commits into
base: 2.10.x
Choose a base branch
from

Conversation

alin1918
Copy link

@alin1918 alin1918 commented Dec 9, 2020

…client #2011

@romainruaud
Copy link
Collaborator

Sounds great !

*/
public function getReadTimeout()
{
return (int) $this->getElasticsearchClientConfigParam('timeout');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change param name to 'read_timeout' here if we change it in the system.xml ?

@rbayet
Copy link
Collaborator

rbayet commented Jan 8, 2021

Hello @alin1918,

Thanks for the PR !
What do you think of the proposed change to use 'read_timeout' as far as possible from the name of the system.xml variable up to the point it is passed as a connection param ?
Also, if we have a new system.xml variable, please add a default value in config.xml.

Feel free also to squash your commits and use the prefix "Fixes #2011 " in your commit message.

Regards,

@alin1918
Copy link
Author

Hello @alin1918,

Thanks for the PR !
What do you think of the proposed change to use 'read_timeout' as far as possible from the name of the system.xml variable up to the point it is passed as a connection param ?
Also, if we have a new system.xml variable, please add a default value in config.xml.

Feel free also to squash your commits and use the prefix "Fixes #2011 " in your commit message.

Regards,

Hi, the reason why I let it as "timeout" instead of "read_timeout", is because is already defined in etc/config.xml as "timeout" (but not used), the fact that the "timeout" name is being use in the library that creates the curl object, and also that the curl option is called being defined is CURLOPT_TIMEOUT. In etc/adminhtml/system.xml the label states that is "Read Timeout".
I have no problem changing to read_timeout, just wanted to point out my reasoning in case you missed any of those.

Just let me know and I can change it. Thanks.

@rbayet rbayet assigned rbayet and alin1918 and unassigned alin1918 and rbayet Jan 11, 2021
@rbayet
Copy link
Collaborator

rbayet commented Jan 11, 2021

Hello @alin1918,

Thanks for your explanations. Indeed you used the correct naming conventions.
Could you simply squash your two commits with a commit message along the way of "Fixes #2011 ES client support for connection and read timeout" ?

Regards,
Richard

@alinalexandru
Copy link

@rbayet
There is one thing that might be done here.
To spit that timeout into 2 fields (frontend and admin). During reindex you might need to have a higher value for read timeout. (because it takes longer to process), and when it's used in frontend to mark the server as down much faster.

For example for frontend use: 2-3 seconds should be ok.
For admin usage (reindex): 30-60 seconds.

We are using this patch in production, already

@rbayet
Copy link
Collaborator

rbayet commented Jan 11, 2021

@alin1918,

I was thinking about that test case of reindexing on a huge catalog and also for some particular operations.
If that cannot be nicely done, maybe we'll go with the connection_timeout (can't seem to find where the support for it disappeared) for now and rethink about the read_timeout

Regards,

@alin1918
Copy link
Author

@rbayet I will do some tests to see how will this work with a big reindexing and see if there is an easy fix for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants