openshift / linuxptp-daemon

Linuxptp daemon runs as kubernetes DaemonSet and manages linuxptp processes such as ptp4l, phc2sys and timemaster.
Apache License 2.0
28 stars 30 forks source link

OCPBUGS-37044: [release-4.15] prevent writing uninitialized TimePropertiesDS #343

Closed vitus133 closed 3 months ago

vitus133 commented 3 months ago

This PR fixes a bug where the daemon wrote uninitialized values to the time properties dataset, which led to corrupting the ptp time scale, current UTC offset and other dataset properties. The fix is done by always initializing the time properties according to the current UTC offset and a predefined set of flags. Leap manager was changed to provide current UTC offset to external packages.

This is a manual cherry-pick of #341 /cc @aneeshkp @jzding @josephdrichard @nishant-parekh

openshift-ci-robot commented 3 months ago

@vitus133: This pull request references Jira Issue OCPBUGS-37044, which is invalid:

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](https://github.com/openshift/linuxptp-daemon/pull/343): >This PR fixes a bug where the daemon wrote uninitialized values to the time properties dataset, which led to corrupting the ptp time scale, current UTC offset and other dataset properties. The fix is done by always initializing the time properties according to the current UTC offset and a predefined set of flags. Leap manager was changed to provide current UTC offset to external packages. > >This is a manual cherry-pick of #341 >/cc @aneeshkp @jzding @josephdrichard @nishant-parekh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Flinuxptp-daemon). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
aneeshkp commented 3 months ago

/jira refresh

openshift-ci-robot commented 3 months ago

@aneeshkp: This pull request references Jira Issue OCPBUGS-37044, which is invalid:

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](https://github.com/openshift/linuxptp-daemon/pull/343#issuecomment-2263243935): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Flinuxptp-daemon). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
aneeshkp commented 3 months ago

/label backport-risk-assessed

aneeshkp commented 3 months ago

/label backport-risk-assessed,

openshift-ci[bot] commented 3 months ago

@aneeshkp: The label(s) /label backport-risk-assessed, cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to [this](https://github.com/openshift/linuxptp-daemon/pull/343#issuecomment-2271326530): >/label backport-risk-assessed, Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
aneeshkp commented 3 months ago

/label backport-risk-assessed

Bonnie-Block commented 3 months ago

/label cherry-pick-approved

aneeshkp commented 3 months ago

/jira refresh

openshift-ci-robot commented 3 months ago

@aneeshkp: This pull request references Jira Issue OCPBUGS-37044, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug * bug is open, matching expected state (open) * bug target version (4.15.z) matches configured target version for branch (4.15.z) * bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST) * release note type set to "Release Note Not Required" * dependent bug [Jira Issue OCPBUGS-37043](https://issues.redhat.com//browse/OCPBUGS-37043) is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA)) * dependent [Jira Issue OCPBUGS-37043](https://issues.redhat.com//browse/OCPBUGS-37043) targets the "4.16.z" version, which is one of the valid target versions: 4.16.0, 4.16.z * bug has dependents

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

In response to [this](https://github.com/openshift/linuxptp-daemon/pull/343#issuecomment-2271351499): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Flinuxptp-daemon). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
aneeshkp commented 3 months ago

/lgtm

openshift-ci[bot] commented 3 months ago

@vitus133: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
aneeshkp commented 3 months ago

/lgtm

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aneeshkp, vitus133

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: - ~~[OWNERS](https://github.com/openshift/linuxptp-daemon/blob/release-4.15/OWNERS)~~ [aneeshkp,vitus133] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci-robot commented 3 months ago

@vitus133: Jira Issue OCPBUGS-37044: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-37044 has been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/linuxptp-daemon/pull/343): >This PR fixes a bug where the daemon wrote uninitialized values to the time properties dataset, which led to corrupting the ptp time scale, current UTC offset and other dataset properties. The fix is done by always initializing the time properties according to the current UTC offset and a predefined set of flags. Leap manager was changed to provide current UTC offset to external packages. > >This is a manual cherry-pick of #341 >/cc @aneeshkp @jzding @josephdrichard @nishant-parekh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Flinuxptp-daemon). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-bot commented 3 months ago

[ART PR BUILD NOTIFIER]

Distgit: linuxptp-daemon This PR has been included in build ose-linuxptp-daemon-container-v4.15.0-202408071539.p0.g66d46bc.assembly.stream.el9. All builds following this will include this PR.