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

HPCC4J-630 Ensure Filespray path constructed correctly #739

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

rpastrana
Copy link
Member

@rpastrana rpastrana commented Aug 20, 2024

  • Add util method to append paths
  • Add junit test for new methods
  • Ensure wsfs methods use new method

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change is a breaking change (fix or feature that will cause existing behavior to change).

Checklist:

  • I have created a corresponding JIRA ticket for this submission
  • My code follows the code style of this project.
    • I have applied the Eclipse code-format template provided.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the HPCC Systems CONTRIBUTORS document (https://github.com/hpcc-systems/HPCC-Platform/wiki/Guide-for-contributors).
  • The change has been fully tested:
    • This change does not cause any existing JUnits to fail.
    • I have include JUnit coverage to test this change
    • I have performed system test and covered possible regressions and side effects.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Premature optimization
    • This change fixes the problem, not just the symptom

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net/browse/HPCC4J-630

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

@rpastrana rpastrana requested a review from jpmcmu August 20, 2024 17:54
@rpastrana
Copy link
Member Author

@jpmcmu please review

@rpastrana rpastrana force-pushed the HPCC4J-630-LZPath branch 3 times, most recently from a87ab8c to 5b17b8a Compare August 20, 2024 18:51
Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

@rpastrana Looks good to me, a few questions and a typo but no required changes IMO

@@ -1005,7 +1005,7 @@ public ProgressResponseWrapper sprayVariable(DelimitedDataOptions options, DropZ

SprayVariable request = new SprayVariable();
request.setSourceIP(targetDropZone.getNetAddress());
request.setSourcePath(Utils.ensureTrailingPathSlash(targetDropZone.getPath()) + sourceFileName);
request.setSourcePath(Utils.ensureTrailingPathSlash(Utils.appendPathSections(targetDropZone.getPath(),sourceFileName)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a Utils function that builds the path and ensures there is trailing path slash?

@@ -1161,7 +1161,7 @@ public ProgressResponseWrapper sprayXML(DropZoneWrapper targetDropZone, String s

request.setDestGroup(destGroup);
request.setSourceIP(targetDropZone.getNetAddress());
request.setSourcePath(Utils.ensureTrailingPathSlash(targetDropZone.getPath()) + sourceFileName);
request.setSourcePath(Utils.ensureTrailingPathSlash(Utils.appendPathSections(targetDropZone.getPath(), sourceFileName)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the trailing path slash still needed here, or was that a requirement due to how the paths were being built?

@@ -1317,7 +1317,7 @@ public ProgressResponseWrapper sprayFixed(DropZoneWrapper targetDropZone, String
request.setDestGroup(destGroup);
request.setSourceRecordSize(recordSize);
request.setSourceIP(targetDropZone.getNetAddress());
request.setSourcePath(Utils.ensureTrailingPathSlash(targetDropZone.getPath()) + sourceFileName);
request.setSourcePath(Utils.ensureTrailingPathSlash(Utils.appendPathSections(targetDropZone.getPath(), sourceFileName)));
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the valid path schemas? Is it just Linux or are Windows paths valid?

}
catch (Exception e)
{
throw new Exception("Could not append path sections, ensure original path sections are valid contain path seperator");
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo here missing an and

- Adds util methods to append paths
- Adds util methods to detect path seperator from sample path
- Adds junit test for new methods
- Ensures wsfs methods use new util path append method
- Ends wsfs use of ensuretrailingslash method

Signed-off-by: Rodrigo Pastrana <[email protected]>
@rpastrana rpastrana requested a review from jpmcmu August 21, 2024 18:21
@rpastrana
Copy link
Member Author

@jpmcmu please take a look again. You're right, there was no longer a need to ensure the trailing path on the properly appended path

Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

@rpastrana looks good to me

@rpastrana
Copy link
Member Author

@jchambers-ln this pr is ready to merge, existing tests passed. We can hold up the merge, If you'd like to verify fix

@jchambers-ln
Copy link
Member

I've verified this should fix the issue; I didn't go sniffing all the edge cases, but it solves the issue we were seeing with alpha dev not being able to spray files.

@rpastrana rpastrana merged commit 9162574 into hpcc-systems:candidate-9.6.x Aug 23, 2024
4 of 6 checks passed
Copy link

Jirabot Action Result:
Added fix version: 9.6.42
Added fix version: 9.8.16
Workflow Transition: 'Resolve issue'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants