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

OCPBUGS-33883: DO NOT MERGE: validate haproxy26-2.6.13-3.rhaos4.15.el8.x86_64.rpm #597

Open
wants to merge 1 commit into
base: release-4.15
Choose a base branch
from

Conversation

frobware
Copy link
Contributor

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 16, 2024
@openshift-ci openshift-ci bot requested review from gcs278 and Miciah May 16, 2024 14:12
Copy link
Contributor

openshift-ci bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from frobware. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@frobware
Copy link
Contributor Author

frobware commented May 16, 2024

Patch for branch rhaos-4.15-rhel-8 in https://pkgs.devel.redhat.com/cgit/rpms/haproxy/

From dc4ed2c3b68c4c30952110a13dd5c7041fe8942d Mon Sep 17 00:00:00 2001
From: Andrew McDermott <[email protected]>
Date: Thu, 16 May 2024 14:21:43 +0100
Subject: OCPBUGS-32369: HAProxy consuming high cpu usage

- Resolve https://issues.redhat.com/browse/OCPBUGS-32369 (HAProxy consuming high cpu usage)
- Carry fix for https://github.com/haproxy/haproxy/issues/2537
- Fix for issue 2537 picked from https://git.haproxy.org/?p=haproxy.git;a=commit;h=4a9e3e102e192b9efd17e3241a6cc659afb7e7dc
---
 ...y-only-tid-0-must-not-sleep-if-got-s.patch | 44 +++++++++++++++++++
 haproxy.spec                                  | 11 ++++-
 2 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 0001-BUG-MINOR-haproxy-only-tid-0-must-not-sleep-if-got-s.patch

diff --git a/0001-BUG-MINOR-haproxy-only-tid-0-must-not-sleep-if-got-s.patch b/0001-BUG-MINOR-haproxy-only-tid-0-must-not-sleep-if-got-s.patch
new file mode 100644
index 0000000..50f54cc
--- /dev/null
+++ b/0001-BUG-MINOR-haproxy-only-tid-0-must-not-sleep-if-got-s.patch
@@ -0,0 +1,44 @@
+From d256f8f3157af29875a915e87e171ec81194e88c Mon Sep 17 00:00:00 2001
+From: Valentine Krasnobaeva <[email protected]>
+Date: Mon, 6 May 2024 14:24:41 +0200
+Subject: BUG/MINOR: haproxy: only tid 0 must not sleep if got signal
+
+This patch fixes the commit eea152ee68
+("BUG/MINOR: signals/poller: ensure wakeup from signals").
+
+There is some probability that run_poll_loop() becomes inifinite, if
+TH_FL_SLEEPING is withdrawn from all threads in the second signal_queue_len
+check, when a signal has received just after the first one.
+
+In such particular case, the 'wake' variable, which is used to terminate
+thread's poll loop is never reset to 0. So, we never enter to the "stopping"
+part of the run_poll_loop() and threads, except the one with id 0 (tid 0
+handles signals), will continue to call _do_poll() eternally and will never
+sleep, as its TH_FL_SLEEPING flag was unset.
+
+This flag needs to be removed only for the tid 0, as it was done in the first
+signal_queue_len check.
+
+This fixes an issue #2537 "infinite loop when shutting down".
+
+This fix must be backported in every stable version.
+---
+ src/haproxy.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/haproxy.c b/src/haproxy.c
+index a6349d420..6ed532527 100644
+--- a/src/haproxy.c
++++ b/src/haproxy.c
+@@ -2868,7 +2868,7 @@ void run_poll_loop()
+ 			if (thread_has_tasks()) {
+ 				activity[tid].wake_tasks++;
+ 				_HA_ATOMIC_AND(&sleeping_thread_mask, ~tid_bit);
+-			} else if (signal_queue_len) {
++			} else if (signal_queue_len && tid == 0) {
+ 				/* this check is required to avoid
+ 				 * a race with wakeup on signals using wake_threads() */
+ 				_HA_ATOMIC_AND(&sleeping_thread_mask, ~tid_bit);
+-- 
+2.42.0
+
diff --git a/haproxy.spec b/haproxy.spec
index 707fa0a..597852e 100644
--- a/haproxy.spec
+++ b/haproxy.spec
@@ -10,7 +10,7 @@
 
 Name:           haproxy
 Version:        2.6.13
-Release:        2.rhaos4.15%{?dist}
+Release:        3.rhaos4.15%{?dist}
 Summary:        Do not ship, install or use this, use %{real_name} subpackage instead
 
 License:        GPLv2+
@@ -24,6 +24,9 @@ Patch0:         0001-BUG-MINOR-fd-always-remove-late-updates-when-freeing.patch
 # https://issues.redhat.com/browse/OCPBUGS-20325 (CVE-2023-40225)
 Patch1:         0001-BUG-MAJOR-http-reject-any-empty-content-length-heade.patch
 
+# https://issues.redhat.com/browse/OCPBUGS-32369
+Patch2:         0001-BUG-MINOR-haproxy-only-tid-0-must-not-sleep-if-got-s.patch
+
 BuildRequires:  openssl-devel
 BuildRequires:  pcre-devel
 BuildRequires:  zlib-devel
@@ -56,6 +59,7 @@ availability environments. Indeed, it can:
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 regparm_opts=
@@ -97,6 +101,11 @@ fi
 %{_sbindir}/%{name}
 
 %changelog
+* Thu May 16 2024 Andrew McDermott <[email protected]> - 2.6.13-3.rhaos4.15
+- Resolve https://issues.redhat.com/browse/OCPBUGS-32369 (HAProxy consuming high cpu usage)
+- Carry fix for https://github.com/haproxy/haproxy/issues/2537
+- Fix for issue 2537 picked from https://git.haproxy.org/?p=haproxy.git;a=commit;h=4a9e3e102e192b9efd17e3241a6cc659afb7e7dc
+
 * Wed Oct 11 2023 Andrew McDermott <[email protected]> - 2.6.13-2.rhaos4.15
 - Resolve https://issues.redhat.com/browse/OCPBUGS-20325 (CVE-2023-40225)
 
-- 
2.44.0

Copy link
Contributor

openshift-ci bot commented May 16, 2024

@frobware: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@frobware frobware changed the title DO NOT MERGE: validate haproxy26-2.6.13-3.rhaos4.15.el8.x86_64.rpm OCPBUGS-33883: DO NOT MERGE: validate haproxy26-2.6.13-3.rhaos4.15.el8.x86_64.rpm May 17, 2024
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels May 17, 2024
@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Jira Issue OCPBUGS-33883, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required"
  • expected Jira Issue OCPBUGS-33883 to depend on a bug targeting a version in 4.16.0 and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

/hold

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label May 17, 2024
@gcs278
Copy link
Contributor

gcs278 commented May 17, 2024

Patch LGTM.

$ git checkout rhaos-4.15-rhel-8
$ git pull
$ git am ~/patches/OCPBUGS-32369-HAProxy-consuming-high-cpu-usage-4.15.patch
Applying: OCPBUGS-32369: HAProxy consuming high cpu usage
.git/rebase-apply/patch:46: space before tab in indent.
 			if (thread_has_tasks()) {
.git/rebase-apply/patch:47: space before tab in indent.
 				activity[tid].wake_tasks++;
.git/rebase-apply/patch:48: space before tab in indent.
 				_HA_ATOMIC_AND(&sleeping_thread_mask, ~tid_bit);
.git/rebase-apply/patch:51: space before tab in indent.
 				/* this check is required to avoid
.git/rebase-apply/patch:52: space before tab in indent.
 				 * a race with wakeup on signals using wake_threads() */
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.
$ git log -n 1
commit 8be6989d93e82f91ae25058b367d1ef61aa08229 (HEAD -> rhaos-4.15-rhel-8)
Author: Andrew McDermott <[email protected]>
Date:   Thu May 16 14:21:43 2024 +0100

    OCPBUGS-32369: HAProxy consuming high cpu usage
    
    - Resolve https://issues.redhat.com/browse/OCPBUGS-32369 (HAProxy consuming high cpu usage)
    - Carry fix for https://github.com/haproxy/haproxy/issues/2537
    - Fix for issue 2537 picked from https://git.haproxy.org/?p=haproxy.git;a=commit;h=4a9e3e102e192b9efd17e3241a6cc659afb7e7dc
$ git diff HEAD~ HEAD
[...]

@frobware
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Jira Issue OCPBUGS-33883, which is invalid:

  • expected dependent Jira Issue OCPBUGS-32369 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants