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

Add configurable API Timeouts #463

Merged

Conversation

fao89
Copy link
Contributor

@fao89 fao89 commented Oct 28, 2024

This patch adds an apiTimeout field to the HeatSpecBase to allow human operators to simultaneously configure the timeouts for HAProxy, Apache, and the rpc_response_timeout.

The apiTimeout defaults to 60 seconds, to mimic the behavior present in OSP17.

Having different timeouts for HAProxy, Apache, and rpc_response_timeout is possible setting the HAProxy timeout in the apiOverride, the Apache timeout with apiTimeout, and setting rpc_response_timeout in the top level Heat customServiceConfig.

To be able to change the HAProxy value based on the apiTimeout with any update (and not just the first time) the code adds a custom annotation "api.heat.openstack.org/timeout" with the value that was initially set, this way flags it as being set by the heat-operator.

closes OSPRH-10965

Copy link
Contributor

openshift-ci bot commented Oct 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fao89

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fao89 fao89 requested review from rabi and bshephar and removed request for olliewalsh and viroel October 28, 2024 19:32
Comment on lines +264 to +266
annotations[heatAnno] = timeout
annotations[haProxyAnno] = timeout
Copy link
Collaborator

Choose a reason for hiding this comment

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

How are these being used? This function isn't called from anywhere that I can see, and it doesn't return anything. Should we be taking in a pointer to an annotations map instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fao89 added a commit to fao89/openstack-operator that referenced this pull request Oct 29, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Oct 29, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Oct 29, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
@@ -7,6 +7,8 @@ num_engine_workers=4
auth_encryption_key={{ .AuthEncryptionKey }}
use_stderr=true
transport_url={{ .TransportURL }}
# Keep the RPC call timeout in sync with HAProxy and Apache timeouts
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think rpc_response_timeout default of 60 would work for heat. It's 600 in 17.1 along with apache/httpd timeout. Btw where is haproxy in the picture?

Copy link
Contributor Author

@fao89 fao89 Oct 29, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

right, should we mention the route timeout instead of haproxy though it translates to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change it

Copy link
Collaborator

Choose a reason for hiding this comment

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

HAProxy as in the one used for OpenShift ingress. So we pass an annotation to the Route to configure HAProxy timeout on the OpenShift Route.

Does it make sense to group RPC with API? Feels like a loose relationship at best.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fao89 added a commit to fao89/openstack-operator that referenced this pull request Oct 29, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Oct 29, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
@@ -1353,6 +1353,7 @@ func initTemplateParameters(
"MemcachedServersWithInet": mc.GetMemcachedServerListWithInetString(),
"MemcachedTLS": mc.GetMemcachedTLSSupport(),
"DatabaseConnection": mysqlConnectionString,
"TimeOut": instance.Spec.APITimeout,

Choose a reason for hiding this comment

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

nit: Timeout used everywhere else

This patch adds an apiTimeout field to the HeatSpecBase to allow human operators to simultaneously configure the timeouts for HAProxy, Apache, and the rpc_response_timeout.

The apiTimeout defaults to 60 seconds, to mimic the behavior present in OSP17.

Having different timeouts for HAProxy, Apache, and rpc_response_timeout is possible setting the HAProxy timeout in the apiOverride, the Apache timeout with apiTimeout, and setting rpc_response_timeout in the top level Heat customServiceConfig.

To be able to change the HAProxy value based on the apiTimeout with any update (and not just the first time) the code adds a custom annotation "api.heat.openstack.org/timeout" with the value that was initially set, this way flags it as being set by the heat-operator.

closes OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
Copy link
Contributor

@rabi rabi left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 5, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit bd9afac into openstack-k8s-operators:main Nov 5, 2024
7 checks passed
fao89 added a commit to fao89/openstack-operator that referenced this pull request Nov 5, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Nov 5, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Nov 5, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
fao89 added a commit to fao89/openstack-operator that referenced this pull request Nov 5, 2024
Depends-On: openstack-k8s-operators/heat-operator#463

ref OSPRH-10965

Signed-off-by: Fabricio Aguiar <[email protected]>
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