Skip to content

ptp_operator: resolve master alias before publishing HOLDOVER event#677

Open
edcdavid wants to merge 3 commits into
redhat-cne:mainfrom
edcdavid:guard-master-alias
Open

ptp_operator: resolve master alias before publishing HOLDOVER event#677
edcdavid wants to merge 3 commits into
redhat-cne:mainfrom
edcdavid:guard-master-alias

Conversation

@edcdavid
Copy link
Copy Markdown
Contributor

When the HOLDOVER path in ParsePTP4l fires during ptp4l startup, the
alias on ptpStats[master] may not yet be populated because no
"master offset" log line has been parsed for the new process. This
causes the ptp-state-change event to be published on the bare
ResourceAddress ".../master" instead of ".../ens3fx/master". Subsequent
recovery events use the per-interface address, so the aggregate
".../master" channel is never updated past HOLDOVER.

Resolve the alias from the ptp4l config's slave interface
(GetAliasByInterface) when the cached value is empty, matching the
pattern already used by the clock-class-change and master-offset paths.
The resolved alias is cached via SetAlias so that the holdover timeout
goroutine also uses the correct value.

When the HOLDOVER path in ParsePTP4l fires during ptp4l startup, the
alias on ptpStats[master] may not yet be populated because no
"master offset" log line has been parsed for the new process. This
causes the ptp-state-change event to be published on the bare
ResourceAddress ".../master" instead of ".../ens3fx/master". Subsequent
recovery events use the per-interface address, so the aggregate
".../master" channel is never updated past HOLDOVER.

Resolve the alias from the ptp4l config's slave interface
(GetAliasByInterface) when the cached value is empty, matching the
pattern already used by the clock-class-change and master-offset paths.
The resolved alias is cached via SetAlias so that the holdover timeout
goroutine also uses the correct value.
@openshift-ci openshift-ci Bot requested review from aneeshkp and josephdrichard May 11, 2026 22:31
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

edcdavid added 2 commits May 12, 2026 11:32
Verify that when ptpStats[master] has no cached alias, the HOLDOVER
path in ParsePTP4l resolves it from the ptp4l config's slave interface
via GetAliasByInterface and caches it with SetAlias.
Removed GOPATH and GOROOT checks from the Makefile to streamline the build process. Updated the 'gha' target to directly build plugins and run unit tests with coverage, excluding specific directories for accurate coverage results. Modified the unit-test.sh script to filter coverage output more effectively. Additionally, adjusted the coverage-gate.sh script to ensure proper restoration of the Makefile and unit-test.sh after execution.
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.

1 participant