Skip to content

Conversation

pmtk
Copy link
Member

@pmtk pmtk commented Feb 3, 2025

No description provided.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 3, 2025
@openshift-ci-robot
Copy link

@pmtk: This pull request references Jira Issue OCPBUGS-48163, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

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:

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 Feb 3, 2025
@openshift-ci openshift-ci bot requested review from ggiguash and jerpeter1 February 3, 2025 07:46
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2025
@pmtk
Copy link
Member Author

pmtk commented Feb 3, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Feb 3, 2025
@openshift-ci-robot
Copy link

@pmtk: This pull request references Jira Issue OCPBUGS-48163, which is valid.

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

Requesting review from QA contact:
/cc @jogeo

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Feb 3, 2025
@openshift-ci openshift-ci bot requested a review from jogeo February 3, 2025 07:47

// GenerateUniqueTempPath returns a filepath from given path with extra suffix
// which doesn't exist.
func GenerateUniqueTempPath(path string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use https://pkg.go.dev/os#CreateTemp instead of this code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could in .nodename creation, but not in the atomic_dir_copy.go. This function gives us a path that we can use either as a file or a dir. CreateTemp will return a File, which can only be a file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current function seems to be flawed because it only checks for a file existence, but does not create any. So, if the code is running in parallel, there is a chance that we'll be getting the same path back.

Copy link
Member Author

@pmtk pmtk Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't execute it in parallel (and we don't call it with the same path - it's always different). Also, if we use this function to get a temporary unique path for a directory, how does creating file helps us?
BTW. This isn't new function - it was moved from state.go and it's proven to be working for some time already

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can leave this code as-is if it's called under certain conditions, but as a generic implementation, this function is flawed.
It does not create objects on the file system, but uses object existence as a test for a validity of the generated name.
This is a race condition when the function is called from different threads for the same path - random number generation might return the same output and the function would succeed because file object is not on the file system yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created https://issues.redhat.com/browse/USHIFT-5373 to follow-up on this separately.
Let's not hold this review on this topic.

@ggiguash
Copy link
Contributor

ggiguash commented Feb 7, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2025
Copy link
Contributor

openshift-ci bot commented Feb 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, pmtk

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

Copy link
Contributor

openshift-ci bot commented Feb 7, 2025

@pmtk: 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.

@openshift-merge-bot openshift-merge-bot bot merged commit a7b5364 into openshift:main Feb 7, 2025
11 checks passed
@openshift-ci-robot
Copy link

@pmtk: Jira Issue OCPBUGS-48163: All pull requests linked via external trackers have merged:

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

In response to this:

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
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants