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

Bug 1974277: Fix conditional order for setting net device param. #239

Merged
merged 1 commit into from Jun 22, 2021

Conversation

jmencak
Copy link
Contributor

@jmencak jmencak commented Jun 21, 2021

The conditional for setting a net device parameter in TuneD has a wrong order where it can potentially try to first cast a string to int in a wrong manner and only then check if the value is a specific integer value.

Upstream TuneD fix: redhat-performance/tuned#360

Resolves rhbz#1974277.

@jmencak
Copy link
Contributor Author

jmencak commented Jun 21, 2021

Subject to upstream patch merging:
redhat-performance/tuned#360
/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 Jun 21, 2021
@openshift-ci openshift-ci bot requested review from dagrayvid and kpouget June 21, 2021 09:50
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2021
@jmencak jmencak changed the title Fix conditional order for setting net device param. Bug 1974277: Fix conditional order for setting net device param. Jun 21, 2021
@openshift-ci openshift-ci bot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Jun 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 21, 2021

@jmencak: This pull request references Bugzilla bug 1974277, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

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

In response to this:

Bug 1974277: Fix conditional order for setting net device param.

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/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jun 21, 2021
@jmencak
Copy link
Contributor Author

jmencak commented Jun 21, 2021

/bugzilla refresh

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jun 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 21, 2021

@jmencak: This pull request references Bugzilla bug 1974277, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (skordas@redhat.com), skipping review request.

In response to this:

/bugzilla 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 kubernetes/test-infra repository.

@openshift-ci openshift-ci bot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jun 21, 2021
@jmencak
Copy link
Contributor Author

jmencak commented Jun 21, 2021

/cc @yanirq

@openshift-ci openshift-ci bot requested a review from yanirq June 21, 2021 09:51
@kpouget
Copy link

kpouget commented Jun 21, 2021

makes sense to me,

(int(dev_params[next(iter(d))]) == 0 or str(dev_params[next(iter(d))]) == 'n/a')

the 2nd hand of the or can never be true, as int(...) will raise an exception if dev_params[next(iter(d))] isn't a sequence of digits, eg n/a

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2021
@yanirq
Copy link
Contributor

yanirq commented Jun 21, 2021

makes sense to me,

(int(dev_params[next(iter(d))]) == 0 or str(dev_params[next(iter(d))]) == 'n/a')

the 2nd hand of the or can never be true, as int(...) will raise an exception if dev_params[next(iter(d))] isn't a sequence of digits, eg n/a

yes. this is the reason for the fix. tuned throws an unhandled exception in that case.
/lgtm

@yanirq
Copy link
Contributor

yanirq commented Jun 21, 2021

/hold - for NTO reviewers

@jmencak
Copy link
Contributor Author

jmencak commented Jun 21, 2021

No need for the torture, this patch cannot possibly cause an upgrade failure
/override ci/prow/e2e-upgrade

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 21, 2021

@jmencak: Overrode contexts on behalf of jmencak: ci/prow/e2e-upgrade

In response to this:

No need for the torture, this patch cannot possibly cause an upgrade failure
/override ci/prow/e2e-upgrade

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/test-infra repository.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2021
@kpouget
Copy link

kpouget commented Jun 22, 2021

indeed, makes more sense written like that!

The conditional for setting a net device parameter in TuneD has a wrong
order where it can potentially try to first cast a string to int in a
wrong manner and only then check if the value is a specific integer
value.

Upstream TuneD fix: redhat-performance/tuned#360

Resolves rhbz#1974277.
@jmencak
Copy link
Contributor Author

jmencak commented Jun 22, 2021

redhat-performance/tuned#360 merged
Squashed commits.
/hold cancel
@yanirq , feel free to add /lgtm if this looks good.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 22, 2021
@yanirq
Copy link
Contributor

yanirq commented Jun 22, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak, yanirq

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 4ebc4ec into openshift:master Jun 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

@jmencak: All pull requests linked via external trackers have merged:

Bugzilla bug 1974277 has been moved to the MODIFIED state.

In response to this:

Bug 1974277: Fix conditional order for setting net device param.

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/test-infra repository.

@jmencak
Copy link
Contributor Author

jmencak commented Jun 22, 2021

/cherry-pick release-4.8

@openshift-cherrypick-robot

@jmencak: new pull request created: #240

In response to this:

/cherry-pick release-4.8

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/test-infra repository.

@jmencak jmencak deleted the 4.9-bz1974277 branch June 22, 2021 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants