Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Add delay between attempts of invoking requests #398

Conversation

masayag
Copy link
Collaborator

@masayag masayag commented Jun 5, 2023

What this PR does / why we need it:
With the current implementation, the client intensively sends requests to the workflow service if the former request failed. This intensity leads to high CPU consumption which impacts both client and mainly the server.

By adding a small timeout between failed requests, the chance for completing a workflow increases and so the resource consumption drops significantly (4-5% CPU vs over 100%).

This is a temporary fix before replacing the current implementation with Executor service and future.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story (FLPATH-xxxx):
Fixes #FLPATH-433

Change type

  • New feature
  • Bug fix
  • Unit tests
  • Integration tests
  • CI
  • Documentation
  • Auto-generated SDK code

Impacted services

  • Workflow Service
  • Notification Service

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

@openshift-ci openshift-ci bot requested review from eloycoto and pkliczewski June 5, 2023 18:42
@masayag masayag force-pushed the add_delay_between_attempts branch from 7780b6a to 936e57f Compare June 5, 2023 18:43
@masayag masayag requested a review from gciavarrini June 5, 2023 18:43
With the current implementation, the client intensively sends requests
to the workflow service if the former request failed.
This intensity leads to high CPU consumption which impacts both client
and mainly the server.

By adding a small timeout between failed requests, the chance for
completing a workflow increases and so the resource consumption drops
significantly (20% CPU vs over 100%).

This is a temporary fix before replacing the current implementation with
Executor service and future.

Signed-off-by: Moti Asayag <masayag@redhat.com>
@masayag masayag force-pushed the add_delay_between_attempts branch from 936e57f to 95a3ec5 Compare June 5, 2023 18:48
@openshift-ci
Copy link

openshift-ci bot commented Jun 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RichardW98

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

@openshift-ci openshift-ci bot added the approved label Jun 5, 2023
Copy link
Collaborator

@pkliczewski pkliczewski 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 Jun 6, 2023
@openshift-merge-robot openshift-merge-robot merged commit 02a1e12 into rhdhorchestrator:main Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants