Skip to content

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

Open
alin1918 wants to merge 2 commits into
Smile-SA:2.10.xfrom
alin1918:Smile-Issue-2011
Open

Issue-2011 - Set configuration for readtimeout and set timeout on ES …#2018
alin1918 wants to merge 2 commits into
Smile-SA:2.10.xfrom
alin1918:Smile-Issue-2011

Conversation

@alin1918

@alin1918 alin1918 commented Dec 9, 2020

Copy link
Copy Markdown

…client #2011

@romainruaud

Copy link
Copy Markdown
Collaborator

Sounds great !

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

Copy link
Copy Markdown
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 ?

Comment thread src/module-elasticsuite-core/etc/adminhtml/system.xml
Comment thread src/module-elasticsuite-core/Client/ClientBuilder.php
@rbayet

rbayet commented Jan 8, 2021

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

rbayet commented Jan 11, 2021

Copy link
Copy Markdown
Collaborator

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
Copy Markdown

@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

rbayet commented Jan 11, 2021

Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
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